1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

neovim: autogenerate config.lua file sourced to init.vim (#2716)

This commit is contained in:
Selene Hines 2022-02-23 07:53:31 -07:00 committed by GitHub
parent 838d40d61a
commit 0b1745b4ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
};