From 36b4a39b2bd3bafc0cfd28bf94e1b21f142b6884 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sun, 16 Jun 2024 22:39:53 +0100 Subject: [PATCH] lib/types: allow assigning raw lua to string lua Relax the check a little to allow (slightly) incorrect usage and enable migrating option types to string lua types. --- lib/types.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/types.nix b/lib/types.nix index c3bfe347..5e1127ad 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -9,12 +9,13 @@ let name = "str"; inherit description; descriptionClass = "noun"; - check = lib.isString; + check = v: isString v || isRawType v; merge = lib.options.mergeEqualOption; }; + isRawType = v: v ? __raw && isString v.__raw; in rec { - isRawType = v: v ? __raw && isString v.__raw; + inherit isRawType; rawLua = mkOptionType { name = "rawLua";