neovim: ship RC file as ~/.config/nvim/

this allows easier editing at runtime
This commit is contained in:
2025-08-18 21:22:21 +00:00
parent 4addf857b7
commit 34c2d4f66f
2 changed files with 16 additions and 5 deletions

View File

@@ -67,12 +67,12 @@ in
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
plugins = plugin-packages; plugins = plugin-packages;
customRC = '' # customRC = ''
${builtins.readFile ./vimrc} # ${builtins.readFile ./vimrc}
""""" PLUGIN CONFIG # """"" PLUGIN CONFIG
${plugin-configs} # ${plugin-configs}
''; # '';
}; };
neovim-unwrapped' = with pkgs; neovim-unwrapped.overrideAttrs (upstream: { neovim-unwrapped' = with pkgs; neovim-unwrapped.overrideAttrs (upstream: {
# fix cross compilation: # fix cross compilation:
@@ -122,9 +122,17 @@ in
# due to <https://github.com/NixOS/nixpkgs/pull/344541> # due to <https://github.com/NixOS/nixpkgs/pull/344541>
rubyEnv = null; rubyEnv = null;
withRuby = false; withRuby = false;
wrapRc = false; #< don't force VIMINIT env var
postBuild = lib.replaceStrings [ "if ! $out/bin/nvim-wrapper " ] [ "if false " ] base.postBuild; postBuild = lib.replaceStrings [ "if ! $out/bin/nvim-wrapper " ] [ "if false " ] base.postBuild;
}); });
fs.".config/nvim/init.vim".symlink.text = ''
${builtins.readFile ./vimrc}
""""" PLUGIN CONFIG
${plugin-configs}
'';
# private because there could be sensitive things in the swap # private because there could be sensitive things in the swap
persist.byStore.private = [ ".cache/vim-swap" ]; persist.byStore.private = [ ".cache/vim-swap" ];
env.EDITOR = "vim"; env.EDITOR = "vim";

View File

@@ -1,3 +1,6 @@
" ENV VARS
" VIMINIT=/path/to/init.vim to use a different vimrc
" let the terminal handle mouse events, that way i get OS-level ctrl+shift+c/etc " let the terminal handle mouse events, that way i get OS-level ctrl+shift+c/etc
" this used to be default, until <https://github.com/neovim/neovim/pull/19290> " this used to be default, until <https://github.com/neovim/neovim/pull/19290>
set mouse= set mouse=