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

modules/neovim: fix config generation (#5976)

This commit is contained in:
Austin Horstman 2024-10-21 17:58:46 -05:00 committed by GitHub
parent 1e27f213d7
commit 5ec753a1fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -398,6 +398,13 @@ in {
customRC = cfg.extraConfig; customRC = cfg.extraConfig;
}; };
wrappedNeovim' = pkgs.wrapNeovimUnstable cfg.package (neovimConfig // {
wrapperArgs =
(lib.escapeShellArgs (neovimConfig.wrapperArgs ++ cfg.extraWrapperArgs))
+ " " + extraMakeWrapperArgs + " " + extraMakeWrapperLuaCArgs + " "
+ extraMakeWrapperLuaArgs;
wrapRc = false;
});
in mkIf cfg.enable { in mkIf cfg.enable {
programs.neovim.generatedConfigViml = neovimConfig.neovimRcContent; programs.neovim.generatedConfigViml = neovimConfig.neovimRcContent;
@ -422,11 +429,10 @@ in {
# writes runtime # writes runtime
(map (x: x.runtime) pluginsNormalized) ++ [{ (map (x: x.runtime) pluginsNormalized) ++ [{
"nvim/init.lua" = let "nvim/init.lua" = let
luaRcContent = luaRcContent = lib.optionalString (wrappedNeovim'.initRc != "")
lib.optionalString (neovimConfig.neovimRcContent != "")
"vim.cmd [[source ${ "vim.cmd [[source ${
pkgs.writeText "nvim-init-home-manager.vim" pkgs.writeText "nvim-init-home-manager.vim"
neovimConfig.neovimRcContent wrappedNeovim'.initRc
}]]" + config.programs.neovim.extraLuaConfig }]]" + config.programs.neovim.extraLuaConfig
+ lib.optionalString hasLuaConfig + lib.optionalString hasLuaConfig
config.programs.neovim.generatedConfigs.lua; config.programs.neovim.generatedConfigs.lua;
@ -437,13 +443,6 @@ in {
}; };
}]); }]);
programs.neovim.finalPackage = pkgs.wrapNeovimUnstable cfg.package programs.neovim.finalPackage = wrappedNeovim';
(neovimConfig // {
wrapperArgs = (lib.escapeShellArgs
(neovimConfig.wrapperArgs ++ cfg.extraWrapperArgs)) + " "
+ extraMakeWrapperArgs + " " + extraMakeWrapperLuaCArgs + " "
+ extraMakeWrapperLuaArgs;
wrapRc = false;
});
}; };
} }