From 6bbb5622166b9179f1a135f65cb91280d294109c Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Tue, 16 Apr 2024 16:17:45 +0300 Subject: [PATCH] add support of lib.mkMerge --- neovim.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/neovim.nix b/neovim.nix index e989787..5e56e69 100644 --- a/neovim.nix +++ b/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;