lib: add lznPluginTableType

This commit is contained in:
Ching Pei Yang 2024-07-10 01:40:11 +02:00 committed by Pei Yang Ching
parent f05411c4e0
commit 703aaecbde
2 changed files with 8 additions and 5 deletions

View file

@ -9,7 +9,7 @@
typesCustom = import ./custom.nix {inherit lib;};
in {
inherit (typesDag) dagOf;
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType lznPluginType;
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType lznPluginType lznPluginTableType;
inherit (typesLanguage) diagnostics mkGrammarOption;
inherit (typesCustom) anythingConcatLists char;
}

View file

@ -56,6 +56,7 @@
check = x: lib.nvim.lua.isLuaInline x;
};
lznPluginTableType = attrsOf lznPluginType;
lznPluginType = submodule {
options = {
## Should probably infer from the actual plugin somehow
@ -64,7 +65,9 @@
# type= str;
# }
package = pluginType;
package = mkOption {
type = pluginType;
};
before = mkOption {
type = nullOr luaInline;
@ -80,7 +83,7 @@
event = mkOption {
description = "Lazy-load on event";
default = "null";
default = null;
type = let
event = submodule {
options = {
@ -97,7 +100,7 @@
};
};
in
oneOf [str (listOf str) event];
nullOr (oneOf [str (listOf str) event]);
};
cmd = mkOption {
@ -122,7 +125,7 @@
};
};
in {
inherit extraPluginType fromInputs pluginType luaInline lznPluginType;
inherit extraPluginType fromInputs pluginType luaInline lznPluginType lznPluginTableType;
pluginsOpt = {
description,