lib/modules: add applyExtraConfig

Used for
- mkVimPlugin: extraConfig
- mkNeovimPlugin: extraConfig
- mkLsp: extraConfig
- mkLsp: settings
- mkExtension (telecsope): extraConfig
This commit is contained in:
Matt Sturgeon 2024-11-19 13:55:33 +00:00
parent c7b7b6481b
commit 63cfc84abe
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
6 changed files with 69 additions and 14 deletions

View file

@ -60,14 +60,14 @@
}:
let
cfg = config.${namespace}.${name};
opt = options.${namespace}.${name};
opts = options.${namespace}.${name};
in
{
meta = {
inherit maintainers;
nixvimInfo = {
inherit description;
url = args.url or opt.package.default.meta.homepage;
url = args.url or opts.package.default.meta.homepage;
path = [
namespace
name
@ -115,7 +115,11 @@
(lib.optionalAttrs (isColorscheme && (colorscheme != null)) {
colorscheme = lib.mkDefault colorscheme;
})
(extraConfig cfg)
(lib.optionalAttrs (args ? extraConfig) (
lib.nixvim.modules.applyExtraConfig {
inherit extraConfig cfg opts;
}
))
]
);
};