mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-25 03:39:39 +01:00
programs.neovim: write config in $XDG_CONFIG_HOME/init.vim (#1652)
* neovim: write config in $XDG_CONFIG_HOME/init.vim instead of wrapping the configuration, which has sideeffects https://github.com/NixOS/nixpkgs/issues/55376 * fix: update test accordingly
This commit is contained in:
parent
99f0074362
commit
8e0c1c55fb
2 changed files with 20 additions and 12 deletions
|
|
@ -241,7 +241,18 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = let
|
||||
extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != [ ])
|
||||
''--prefix PATH : "${lib.makeBinPath cfg.extraPackages}"'';
|
||||
neovimConfig = pkgs.neovimUtils.makeNeovimConfig {
|
||||
inherit (cfg)
|
||||
extraPython3Packages withPython3 extraPythonPackages withPython
|
||||
withNodeJs withRuby viAlias vimAlias;
|
||||
configure = cfg.configure // moduleConfigure;
|
||||
plugins = cfg.plugins;
|
||||
};
|
||||
|
||||
in mkIf cfg.enable {
|
||||
assertions = [{
|
||||
assertion = cfg.configure == { } || moduleConfigure == { };
|
||||
message = "The programs.neovim option configure is mutually exclusive"
|
||||
|
|
@ -250,14 +261,12 @@ in {
|
|||
|
||||
home.packages = [ cfg.finalPackage ];
|
||||
|
||||
programs.neovim.finalPackage = pkgs.wrapNeovim cfg.package {
|
||||
inherit (cfg)
|
||||
extraPython3Packages withPython3 extraPythonPackages withPython
|
||||
withNodeJs withRuby viAlias vimAlias;
|
||||
|
||||
extraMakeWrapperArgs = extraMakeWrapperArgs;
|
||||
configure = cfg.configure // moduleConfigure;
|
||||
};
|
||||
xdg.configFile."nvim/init.vim".text = neovimConfig.neovimRcContent;
|
||||
programs.neovim.finalPackage = pkgs.wrapNeovimUnstable cfg.package
|
||||
(neovimConfig // {
|
||||
wrapperArgs = (lib.escapeShellArgs neovimConfig.wrapperArgs) + " "
|
||||
+ extraMakeWrapperArgs;
|
||||
});
|
||||
|
||||
programs.bash.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; };
|
||||
programs.fish.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue