1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19: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;
};
wrappedNeovim' = pkgs.wrapNeovimUnstable cfg.package (neovimConfig // {
wrapperArgs =
(lib.escapeShellArgs (neovimConfig.wrapperArgs ++ cfg.extraWrapperArgs))
+ " " + extraMakeWrapperArgs + " " + extraMakeWrapperLuaCArgs + " "
+ extraMakeWrapperLuaArgs;
wrapRc = false;
});
in mkIf cfg.enable {
programs.neovim.generatedConfigViml = neovimConfig.neovimRcContent;
@ -422,11 +429,10 @@ in {
# writes runtime
(map (x: x.runtime) pluginsNormalized) ++ [{
"nvim/init.lua" = let
luaRcContent =
lib.optionalString (neovimConfig.neovimRcContent != "")
luaRcContent = lib.optionalString (wrappedNeovim'.initRc != "")
"vim.cmd [[source ${
pkgs.writeText "nvim-init-home-manager.vim"
neovimConfig.neovimRcContent
wrappedNeovim'.initRc
}]]" + config.programs.neovim.extraLuaConfig
+ lib.optionalString hasLuaConfig
config.programs.neovim.generatedConfigs.lua;
@ -437,13 +443,6 @@ in {
};
}]);
programs.neovim.finalPackage = pkgs.wrapNeovimUnstable cfg.package
(neovimConfig // {
wrapperArgs = (lib.escapeShellArgs
(neovimConfig.wrapperArgs ++ cfg.extraWrapperArgs)) + " "
+ extraMakeWrapperArgs + " " + extraMakeWrapperLuaCArgs + " "
+ extraMakeWrapperLuaArgs;
wrapRc = false;
});
programs.neovim.finalPackage = wrappedNeovim';
};
}