diff --git a/modules/misc/news/2026/01/2026-01-19_02-17-02.nix b/modules/misc/news/2026/01/2026-01-19_02-17-02.nix new file mode 100644 index 00000000..c8bc5830 --- /dev/null +++ b/modules/misc/news/2026/01/2026-01-19_02-17-02.nix @@ -0,0 +1,8 @@ +{ config, ... }: +{ + time = "2026-01-19T01:17:02+00:00"; + condition = config.programs.neovim.enable; + message = '' + The neovim module now symlinks its plugins into xdg.dataFile."nvim/site/pack/hm" ( ~/.local/share/nvim) instead of modifying the runtimepath via wrapper arguments. + ''; +} diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index a745c254..086390fd 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -437,16 +437,6 @@ in vimPackageInfo = neovimUtils.makeVimPackageInfo (map suppressNotVimlConfig pluginsNormalized); - packpathDirs.hm = vimPackageInfo.vimPackage; - finalPackdir = neovimUtils.packDir packpathDirs; - - packpathWrapperArgs = lib.optionals (packpathDirs.hm.start != [ ] || packpathDirs.hm.opt != [ ]) [ - "--add-flags" - ''--cmd "set packpath^=${finalPackdir}"'' - "--add-flags" - ''--cmd "set rtp^=${finalPackdir}"'' - ]; - wrappedNeovim' = pkgs.wrapNeovimUnstable cfg.package { withNodeJs = cfg.withNodeJs || cfg.coc.enable; plugins = [ ]; @@ -466,11 +456,7 @@ in ps: (cfg.extraPython3Packages ps) ++ (lib.concatMap (f: f ps) vimPackageInfo.pluginPython3Packages); neovimRcContent = cfg.extraConfig; wrapperArgs = - cfg.extraWrapperArgs - ++ extraMakeWrapperArgs - ++ extraMakeWrapperLuaCArgs - ++ extraMakeWrapperLuaArgs - ++ packpathWrapperArgs; + cfg.extraWrapperArgs ++ extraMakeWrapperArgs ++ extraMakeWrapperLuaCArgs ++ extraMakeWrapperLuaArgs; wrapRc = false; }; in @@ -531,6 +517,17 @@ in )) ]; + # 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 = vimPackageInfo.vimPackage; + in + { + enable = allPlugins != [ ]; + source = "${pkgs.neovimUtils.packDir packpathDirs}/pack/hm"; + }; + xdg.configFile = lib.mkMerge ( # writes runtime (map (x: x.runtime) pluginsNormalized)