From 5ec753a1fc4454df9285d8b3ec0809234defb975 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 21 Oct 2024 17:58:46 -0500 Subject: [PATCH] modules/neovim: fix config generation (#5976) --- modules/programs/neovim.nix | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index 8632a7ec8..e8be25f92 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -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'; }; }