From ad5b928830f04e5b3654daf6aa5a19cccc716194 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 18:01:34 +0200 Subject: [PATCH] lz.n: missing type check --- modules/wrapper/lazy/config.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index 645dfb9..5ce308b 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -3,7 +3,7 @@ config, ... }: let - inherit (builtins) toJSON; + inherit (builtins) toJSON typeOf head length; inherit (lib.modules) mkIf; inherit (lib.attrsets) mapAttrsToList; inherit (lib.generators) mkLuaInline; @@ -40,7 +40,10 @@ ${optionalString (spec.after != null) spec.after} end ''; - keys = map toLuzLznKeySpec spec.keys; + keys = + if typeOf spec.keys == "list" && length spec.keys > 0 && typeOf (head spec.keys) == "set" + then map toLuzLznKeySpec spec.keys + else spec.keys; }; lznSpecs = mapAttrsToList toLuaLznSpec cfg.plugins; in {