mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-31 04:04:32 +00:00
Merge accbbb4a04
into 09280e17bb
This commit is contained in:
commit
2a7bf2c6e4
2 changed files with 19 additions and 13 deletions
|
@ -391,20 +391,19 @@ 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;
|
# it gets ignored
|
||||||
};
|
neovimRcContent = cfg.extraConfig;
|
||||||
|
wrapperArgs = (lib.escapeShellArgs (cfg.extraWrapperArgs)) + " "
|
||||||
wrappedNeovim' = pkgs.wrapNeovimUnstable cfg.package (neovimConfig // {
|
+ extraMakeWrapperArgs + " " + extraMakeWrapperLuaCArgs + " "
|
||||||
wrapperArgs =
|
|
||||||
(lib.escapeShellArgs (neovimConfig.wrapperArgs ++ cfg.extraWrapperArgs))
|
|
||||||
+ " " + extraMakeWrapperArgs + " " + extraMakeWrapperLuaCArgs + " "
|
|
||||||
+ extraMakeWrapperLuaArgs;
|
+ extraMakeWrapperLuaArgs;
|
||||||
wrapRc = false;
|
wrapRc = false;
|
||||||
});
|
};
|
||||||
|
|
||||||
|
wrappedNeovim' = neovimConfig;
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
|
|
||||||
programs.neovim.generatedConfigViml = neovimConfig.neovimRcContent;
|
programs.neovim.generatedConfigViml = neovimConfig.neovimRcContent;
|
||||||
|
@ -423,6 +422,14 @@ in {
|
||||||
|
|
||||||
home.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; };
|
home.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; };
|
||||||
|
|
||||||
|
# link the packpath in expected folder so that even unwrapped neovim can pick
|
||||||
|
# home-manager's plugins
|
||||||
|
xdg.dataFile."nvim/site/pack/hm" = let
|
||||||
|
packpathDirs.hm = neovimConfig.vimPackage;
|
||||||
|
in {
|
||||||
|
source = "${pkgs.neovimUtils.packDir packpathDirs}/pack/hm";
|
||||||
|
};
|
||||||
|
|
||||||
xdg.configFile = let
|
xdg.configFile = let
|
||||||
hasLuaConfig = lib.hasAttr "lua" config.programs.neovim.generatedConfigs;
|
hasLuaConfig = lib.hasAttr "lua" config.programs.neovim.generatedConfigs;
|
||||||
in lib.mkMerge (
|
in lib.mkMerge (
|
||||||
|
|
|
@ -21,10 +21,9 @@ lib.mkIf config.test.enableBig {
|
||||||
_module.args.pkgs = lib.mkForce realPkgs;
|
_module.args.pkgs = lib.mkForce realPkgs;
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
vimout=$(mktemp)
|
vimout=$out/nvim-output
|
||||||
echo "redir >> /dev/stdout | echo g:hmExtraConfig | echo g:hmPlugins | redir END" \
|
export HOME=$TESTED/home-files
|
||||||
| ${pkgs.neovim}/bin/nvim -es -u "$TESTED/home-files/.config/nvim/init.lua" \
|
${pkgs.neovim-unwrapped}/bin/nvim -i NONE -V3$out/log.txt +"redir >> $vimout | echo g:hmExtraConfig | echo g:hmPlugins | redir END" +'exit'
|
||||||
> "$vimout" || true
|
|
||||||
assertFileContains "$vimout" "HM_EXTRA_CONFIG"
|
assertFileContains "$vimout" "HM_EXTRA_CONFIG"
|
||||||
assertFileContains "$vimout" "HM_PLUGINS_CONFIG"
|
assertFileContains "$vimout" "HM_PLUGINS_CONFIG"
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Add table
Reference in a new issue