diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index a5bcc463..88683e40 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -365,13 +365,14 @@ in { in mkMerge ( # writes runtime (map (x: x.runtime) pluginsNormalized) ++ [{ - "nvim/init.vim" = mkIf (neovimConfig.neovimRcContent != "") { - text = neovimConfig.neovimRcContent; - }; + "nvim/init-home-manager.vim" = + mkIf (neovimConfig.neovimRcContent != "") { + text = neovimConfig.neovimRcContent; + }; "nvim/init.lua" = let luaRcContent = lib.optionalString (neovimConfig.neovimRcContent != "") - "vim.cmd.source ${config.xdg.configHome}/nvim/init.vim" + "vim.cmd [[source ${config.xdg.configHome}/nvim/init-home-manager.vim]]" + lib.optionalString hasLuaConfig config.programs.neovim.generatedConfigs.lua; in mkIf (luaRcContent != "") { text = luaRcContent; }; diff --git a/tests/modules/programs/neovim/plugin-config.nix b/tests/modules/programs/neovim/plugin-config.nix index 9647fb5a..843330b9 100644 --- a/tests/modules/programs/neovim/plugin-config.nix +++ b/tests/modules/programs/neovim/plugin-config.nix @@ -24,7 +24,7 @@ with lib; }; nmt.script = '' - vimrc="$TESTED/home-files/.config/nvim/init.vim" + vimrc="$TESTED/home-files/.config/nvim/init-home-manager.vim" vimrcNormalized="$(normalizeStorePaths "$vimrc")" assertFileExists "$vimrc"