From 6dd2eed61372cc6d9959fdcc6ec249d438363050 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 13 Feb 2024 17:05:53 +0100 Subject: [PATCH] helpers/vim-plugin/mkVimPlugin: add extraConfig option --- lib/vim-plugin.nix | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/vim-plugin.nix b/lib/vim-plugin.nix index 7339fe71..efadb636 100644 --- a/lib/vim-plugin.nix +++ b/lib/vim-plugin.nix @@ -18,6 +18,7 @@ with lib; { addExtraConfigRenameWarning ? false, extraOptions ? {}, # config + extraConfig ? cfg: {}, extraPlugins ? [], extraPackages ? [], }: let @@ -98,12 +99,19 @@ with lib; { ["plugins" name "settings"] ); - config = mkIf cfg.enable { - inherit extraPackages; - globals = mapAttrs' (n: nameValuePair (globalPrefix + n)) globals; - # does this evaluate package? it would not be desired to evaluate pacakge if we use another package. - extraPlugins = extraPlugins ++ optional (package != null) cfg.package; - }; + config = + mkIf cfg.enable + ( + mkMerge [ + { + inherit extraPackages; + globals = mapAttrs' (n: nameValuePair (globalPrefix + n)) globals; + # does this evaluate package? it would not be desired to evaluate pacakge if we use another package. + extraPlugins = extraPlugins ++ optional (package != null) cfg.package; + } + (extraConfig cfg) + ] + ); }; mkDefaultOpt = {