nvim/package.nix
Guanran Wang 3fbc02368d
flake: refactor package
- loads init.lua directly,
  before it loads a lua file -> vimscript (`customRC`) -> init.lua

- split the wrapper into its own package,
  makes `src` and `runtimeDeps` overridable

- inherit args into `makeNeovimConfig`,
  makes e.g. `vimAlias` in `wrapNeovimUnstable` work
2024-04-10 18:41:58 +08:00

18 lines
457 B
Nix

{
lib,
wrapNeovimUnstable,
neovim-unwrapped,
neovimUtils,
runtimeDeps ? null,
src ? null,
...
} @ args:
wrapNeovimUnstable neovim-unwrapped (neovimUtils.makeNeovimConfig args
// {
# FIXME: append instead of override the entire wrapperArgs
wrapperArgs = ["--prefix" "PATH" ":" "${lib.makeBinPath runtimeDeps}"];
luaRcContent = ''
vim.cmd [[set runtimepath^=${src}]]
${builtins.readFile "${src}/init.lua"}
'';
})