1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 06:59:45 +01:00

programs.neovim: dont wrap init.vim (#2058)

since we want to write it ourself in ~/.config/nvim/init.vim
This commit is contained in:
Matthieu Coudron 2021-06-03 21:37:53 +02:00 committed by GitHub
parent 95da56b783
commit c7e79b5337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 7 deletions

View file

@ -51,8 +51,7 @@ let
(map (x: if x ? plugin && x.optional == true then x.plugin else null)
cfg.plugins);
};
customRC = pkgs.lib.concatMapStrings pluginConfig cfg.plugins
+ cfg.extraConfig;
beforePlugins = "";
};
extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != [ ])
@ -242,11 +241,14 @@ in {
home.packages = [ cfg.finalPackage ];
xdg.configFile."nvim/init.vim".text = neovimConfig.neovimRcContent;
xdg.configFile = mkIf (neovimConfig.neovimRcContent != "") {
"nvim/init.vim".text = neovimConfig.neovimRcContent;
};
programs.neovim.finalPackage = pkgs.wrapNeovimUnstable cfg.package
(neovimConfig // {
wrapperArgs = (lib.escapeShellArgs neovimConfig.wrapperArgs) + " "
+ extraMakeWrapperArgs;
wrapRc = false;
});
programs.bash.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; };

View file

@ -1 +1,5 @@
{ neovim-plugin-config = ./plugin-config.nix; }
{
neovim-plugin-config = ./plugin-config.nix;
# waiting for a nixpkgs patch
# neovim-no-init = ./no-init.nix;
}

View file

@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.neovim = {
enable = true;
package = pkgs.neovim-unwrapped;
vimAlias = true;
withNodeJs = false;
withPython3 = true;
withRuby = false;
extraPython3Packages = (ps: with ps; [ jedi pynvim ]);
};
nmt.script = ''
vimrc="home-files/.config/nvim/init.vim"
assertPathNotExists "$vimrc"
'';
};
}

View file

@ -1,6 +1,3 @@
" configuration generated by NIX
set nocompatible
set packpath^=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vim-pack-dir
set runtimepath^=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vim-pack-dir