From 2167481cc2096e6b712f7977bedf0afc522374fe Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Fri, 21 Jul 2023 15:25:40 +0200 Subject: [PATCH] implement extraPluginConfigs --- modules/core/default.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/core/default.nix b/modules/core/default.nix index 48769ec..5d87c9c 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -302,6 +302,7 @@ in { result; in { vim = { + startPlugins = concatMap (x: x.package) (attrValues cfg.extraPlugins); configRC = { globalsScript = nvim.dag.entryAnywhere (concatStringsSep "\n" globalsScript); @@ -319,6 +320,27 @@ in { in nvim.dag.entryAfter ["globalsScript"] luaConfig; + extraPluginConfigs = let + mkSection = r: '' + -- SECTION: ${r.name} + ${r.data} + ''; + mapResult = r: (wrapLuaConfig (concatStringsSep "\n" (map mkSection r))); + extraPluginsDag = mapAttrs (_: { + dependencies, + setup, + ... + }: + nvim.dag.entryAfter dependencies setup) + cfg.extraPlugins; + pluginConfig = resolveDag { + name = "extra plugins config"; + dag = extraPluginsDag; + inherit mapResult; + }; + in + nvim.dag.entryAfter ["luaScript"] pluginConfig; + # This is probably not the right way to set the config. I'm not sure how it should look like. mappings = let maps = [