languages: coerce server type to list for compat

This commit is contained in:
Ching Pei Yang 2025-07-19 01:33:04 +02:00
commit 9407a3e1c6
No known key found for this signature in database
GPG key ID: B3841364253DC4C8
34 changed files with 98 additions and 103 deletions

View file

@ -1,7 +1,8 @@
{lib}: let
inherit (lib.options) mergeEqualOption;
inherit (lib.lists) singleton;
inherit (lib.strings) isString stringLength match;
inherit (lib.types) listOf mkOptionType;
inherit (lib.types) listOf mkOptionType coercedTo;
in {
mergelessListOf = elemType: let
super = listOf elemType;
@ -27,4 +28,6 @@ in {
description = "RGB color in hex format";
check = v: isString v && (match "#?[0-9a-fA-F]{6}" v) != null;
};
singleOrListOf = t: coercedTo t singleton (listOf t);
}