1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

moar adjustements

This commit is contained in:
Matthieu C. 2024-10-15 11:18:29 +02:00
parent 38dc46f215
commit 4557434487

View file

@ -391,11 +391,16 @@ in {
suppressNotVimlConfig = p: suppressNotVimlConfig = p:
if p.type != "viml" then p // { config = null; } else p; if p.type != "viml" then p // { config = null; } else p;
neovimConfig = pkgs.neovimUtils.makeNeovimConfig { neovimConfig = pkgs.wrapNeovimUnstable cfg.package {
inherit (cfg) extraPython3Packages withPython3 withRuby viAlias vimAlias; inherit (cfg) extraPython3Packages withPython3 withRuby viAlias vimAlias;
withNodeJs = cfg.withNodeJs || cfg.coc.enable; withNodeJs = cfg.withNodeJs || cfg.coc.enable;
plugins = map suppressNotVimlConfig pluginsNormalized; plugins = map suppressNotVimlConfig pluginsNormalized;
customRC = cfg.extraConfig; customRC = cfg.extraConfig;
wrapperArgs = (lib.escapeShellArgs
(cfg.extraWrapperArgs)) + " "
+ extraMakeWrapperArgs + " " + extraMakeWrapperLuaCArgs + " "
+ extraMakeWrapperLuaArgs;
wrapRc = false;
}; };
in mkIf cfg.enable { in mkIf cfg.enable {
@ -418,11 +423,17 @@ in {
# link the packpath in expected folder so that even unwrapped neovim can pick # link the packpath in expected folder so that even unwrapped neovim can pick
# home-manager's plugins # home-manager's plugins
xdg.dataFile = mkMerge (mapAttrsToList (name: val: { xdg.dataFile."nvim/site/pack/hm" = let
"nvim/site/pack/hm-${name}" = { #
source = "${pkgs.neovimUtils.packDir packpathDirs}/pack/${name}"; packpathDirs.hm = neovimConfig.vimPackage;
}; finalPackdir = neovimUtils.packDir packpathDirs;
}) neovimConfig.packpathDirs);
in {
# packdirStart = vimFarm "pack/${packageName}/start" "packdir-start" allPlugins;
# packdirOpt = vimFarm "pack/${packageName}/opt" "packdir-opt" opt;
source = "${pkgs.neovimUtils.packDir packpathDirs}/pack/hm";
};
xdg.configFile = xdg.configFile =
let hasLuaConfig = hasAttr "lua" config.programs.neovim.generatedConfigs; let hasLuaConfig = hasAttr "lua" config.programs.neovim.generatedConfigs;
@ -431,10 +442,10 @@ in {
(map (x: x.runtime) pluginsNormalized) ++ [{ (map (x: x.runtime) pluginsNormalized) ++ [{
"nvim/init.lua" = let "nvim/init.lua" = let
luaRcContent = luaRcContent =
lib.optionalString (neovimConfig.neovimRcContent != "") lib.optionalString (neovimConfig.passthru.initRc != "")
"vim.cmd [[source ${ "vim.cmd [[source ${
pkgs.writeText "nvim-init-home-manager.vim" pkgs.writeText "nvim-init-home-manager.vim"
neovimConfig.neovimRcContent neovimConfig.passthru.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;
@ -445,13 +456,6 @@ in {
}; };
}]); }]);
programs.neovim.finalPackage = pkgs.wrapNeovimUnstable cfg.package programs.neovim.finalPackage = neovimConfig;
(neovimConfig // {
wrapperArgs = (lib.escapeShellArgs
(neovimConfig.wrapperArgs ++ cfg.extraWrapperArgs)) + " "
+ extraMakeWrapperArgs + " " + extraMakeWrapperLuaCArgs + " "
+ extraMakeWrapperLuaArgs;
wrapRc = false;
});
}; };
} }