Skip to content

Commit

Permalink
modules/neovim: fix config generation (#5976)
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman authored Oct 21, 2024
1 parent 1e27f21 commit 5ec753a
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions modules/programs/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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';
};
}

0 comments on commit 5ec753a

Please sign in to comment.