implement extraPluginConfigs

This commit is contained in:
Ching Pei Yang 2023-07-21 15:25:40 +02:00
parent 2319ee082c
commit 2167481cc2
1 changed files with 22 additions and 0 deletions

View File

@ -302,6 +302,7 @@ in {
result; result;
in { in {
vim = { vim = {
startPlugins = concatMap (x: x.package) (attrValues cfg.extraPlugins);
configRC = { configRC = {
globalsScript = nvim.dag.entryAnywhere (concatStringsSep "\n" globalsScript); globalsScript = nvim.dag.entryAnywhere (concatStringsSep "\n" globalsScript);
@ -319,6 +320,27 @@ in {
in in
nvim.dag.entryAfter ["globalsScript"] luaConfig; 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. # This is probably not the right way to set the config. I'm not sure how it should look like.
mappings = let mappings = let
maps = [ maps = [