mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
programs.neovim: expose generatedConfigViml (#2213)
Expose the generated viml config, this has 2 advantages: 1/ user can choose to write the generated config to a file of its choice 2/ the user can prepend/append to the config before writing it xdg.configFile."nvim/init.vim".text = '' " prepend some config ${programs.neovim.generatedConfigViml} " append some config ''; NOTE: this was already possible with xdg.configFile."nvim/init.vim" = mkMerge [ (mkBefore { text = '' " prepend some config ''; }) (mkAfter { text = '' " append some config ''; }) ]
This commit is contained in:
parent
f6f6990fc8
commit
47ad3655ec
1 changed files with 11 additions and 0 deletions
|
@ -132,6 +132,15 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
generatedConfigViml = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
visible = true;
|
||||||
|
readOnly = true;
|
||||||
|
description = ''
|
||||||
|
Generated vimscript config.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.neovim-unwrapped;
|
default = pkgs.neovim-unwrapped;
|
||||||
|
@ -280,6 +289,8 @@ in {
|
||||||
configure.customRC -> programs.neovim.extraConfig
|
configure.customRC -> programs.neovim.extraConfig
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
programs.neovim.generatedConfigViml = neovimConfig.neovimRcContent;
|
||||||
|
|
||||||
home.packages = [ cfg.finalPackage ];
|
home.packages = [ cfg.finalPackage ];
|
||||||
|
|
||||||
xdg.configFile."nvim/init.vim" = mkIf (neovimConfig.neovimRcContent != "") {
|
xdg.configFile."nvim/init.vim" = mkIf (neovimConfig.neovimRcContent != "") {
|
||||||
|
|
Loading…
Reference in a new issue