add support of lib.mkMerge

This commit is contained in:
Dmitriy Pleshevskiy 2024-04-16 16:17:45 +03:00
parent 40bc84d1f8
commit 6bbb562216
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2

View file

@ -20,12 +20,26 @@
}:
let
plugins' = plugins;
mergeAttrs = v:
if builtins.isList v then
lib.foldl lib.recursiveUpdate { } (map mergeAttrs v)
else if v ? _type then
if v._type == "merge" then mergeAttrs v.contents
else if v._type == "if" then lib.optionalAttrs v.condition v.content
else builtins.abort "Unsupported attribute"
else v;
in
let
plugins = mergeAttrs plugins';
inherit (builtins) catAttrs readFile;
myLib = import ./lib.nix { inherit lib substituteAll; } // {
inherit (nix2lua.lib) toLua LuaNil;
};
pluginParams = neovimPlugins // {
inherit tree-sitter plugins enableDevIcons enableTabby enableOrgMode;
themeCfg = theme;