From 0b1745b4ef4c35ec5d554b176539730fcb5ec141 Mon Sep 17 00:00:00 2001 From: Selene Hines Date: Wed, 23 Feb 2022 07:53:31 -0700 Subject: [PATCH] neovim: autogenerate config.lua file sourced to init.vim (#2716) --- modules/programs/neovim.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index 90d94d916..6e496f4fe 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -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) { + 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; };