add support of lib.mkMerge
This commit is contained in:
parent
40bc84d1f8
commit
6bbb562216
1 changed files with 14 additions and 0 deletions
14
neovim.nix
14
neovim.nix
|
@ -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;
|
||||
|
|
Reference in a new issue