Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion modules/programs/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,17 @@ in {
home.packages = [ cfg.finalPackage ];

xdg.configFile."nvim/init.vim" = mkIf (neovimConfig.neovimRcContent != "") {
text = neovimConfig.neovimRcContent;
text = if hasAttr "lua" config.programs.neovim.generatedConfigs then
neovimConfig.neovimRcContent + ''

lua require('init-home-manager')''
else
neovimConfig.neovimRcContent;
};
xdg.configFile."nvim/lua/init-home-manager.lua" =
mkIf (hasAttr "lua" config.programs.neovim.generatedConfigs) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When exactly does this file get generated? generatedConfigs is readonly, and I cannot think of a scenario when it would have a lua attr?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you set your plugin like this:

    {
      plugin = urlview-nvim;
      type = "lua";
	  config = ''
		'';
    }

text = config.programs.neovim.generatedConfigs.lua;
};
xdg.configFile."nvim/coc-settings.json" = mkIf cfg.coc.enable {
source = jsonFormat.generate "coc-settings.json" cfg.coc.settings;
};
Expand Down