From d8e6483c64852bc9042c817ae7b69eeb9fd2d813 Mon Sep 17 00:00:00 2001 From: diniamo Date: Fri, 20 Dec 2024 18:57:35 +0100 Subject: [PATCH] wrapper/lazy: allow luaInline as a type in keys One way of using keys is `{ "", mode = "n" }`, which isn't possible in nvf without luaInline --- lib/types/plugins.nix | 2 +- modules/wrapper/lazy/config.nix | 2 +- modules/wrapper/lazy/lazy.nix | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index 656b7ab8..a70d9699 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -6,7 +6,7 @@ inherit (lib.options) mkOption; inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair; inherit (lib.strings) hasPrefix removePrefix; - inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr; + inherit (lib.types) submodule either package enum str lines anything listOf nullOr; # Get the names of all flake inputs that start with the given prefix. fromInputs = { diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index 6a9a6ea2..45132792 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -97,7 +97,7 @@ keys = if typeOf spec.keys == "list" && length spec.keys > 0 && typeOf (head spec.keys) == "set" then map toLuaLznKeySpec (filter (keySpec: keySpec.key != null) spec.keys) - # empty list or str or (listOf str) + # empty list, str, (listOf str), luaInline or (listOf luaInline) else spec.keys; }; lznSpecs = mapAttrsToList toLuaLznSpec cfg.plugins; diff --git a/modules/wrapper/lazy/lazy.nix b/modules/wrapper/lazy/lazy.nix index e0dbea85..0d98e32c 100644 --- a/modules/wrapper/lazy/lazy.nix +++ b/modules/wrapper/lazy/lazy.nix @@ -1,7 +1,7 @@ {lib, ...}: let inherit (lib.options) mkOption mkEnableOption; inherit (lib.types) enum listOf submodule nullOr str bool int attrsOf anything either oneOf lines; - inherit (lib.nvim.types) pluginType; + inherit (lib.nvim.types) pluginType luaInline; inherit (lib.nvim.config) mkBool; lznKeysSpec = submodule { @@ -135,7 +135,7 @@ }; keys = mkOption { - type = nullOr (oneOf [str (listOf lznKeysSpec) (listOf str)]); + type = nullOr (oneOf [(listOf lznKeysSpec) str (listOf str) luaInline (listOf luaInline)]); default = null; example = '' keys = [