From de42f3bf987b39ae6867ddaa137c3273a198069f Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Wed, 10 Jul 2024 01:40:11 +0200 Subject: [PATCH] lib: add lznPluginTableType --- lib/types/default.nix | 2 +- lib/types/plugins.nix | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/types/default.nix b/lib/types/default.nix index 14ec5667..328b477a 100644 --- a/lib/types/default.nix +++ b/lib/types/default.nix @@ -9,7 +9,7 @@ typesCustom = import ./custom.nix {inherit lib;}; in { inherit (typesDag) dagOf; - inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType lznPluginType; + inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType lznPluginType lznPluginTableType; inherit (typesLanguage) diagnostics mkGrammarOption; inherit (typesCustom) anythingConcatLists char; } diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index e78e0a42..98ea5d5e 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -57,6 +57,7 @@ check = x: lib.nvim.lua.isLuaInline x; }; + lznPluginTableType = attrsOf lznPluginType; lznPluginType = submodule { options = { ## Should probably infer from the actual plugin somehow @@ -65,7 +66,9 @@ # type= str; # } - package = pluginType; + package = mkOption { + type = pluginType; + }; before = mkOption { type = nullOr luaInline; @@ -81,7 +84,7 @@ event = mkOption { description = "Lazy-load on event"; - default = "null"; + default = null; type = let event = submodule { options = { @@ -98,7 +101,7 @@ }; }; in - oneOf [str (listOf str) event]; + nullOr (oneOf [str (listOf str) event]); }; cmd = mkOption { @@ -123,7 +126,7 @@ }; }; in { - inherit extraPluginType fromInputs pluginType luaInline lznPluginType; + inherit extraPluginType fromInputs pluginType luaInline lznPluginType lznPluginTableType; borderType = either (enum borderPresets) (listOf (either str (listOf str)));