helpers: factor out borderType

This commit is contained in:
Gaetan Lepage 2023-11-06 10:49:38 +01:00 committed by Gaétan Lepage
parent 356e0e855b
commit 707054bf23

View file

@ -91,6 +91,13 @@ with lib; rec {
};
};
borderType = with lib.types;
oneOf [
str
(listOf str)
(listOf (listOf str))
];
# Creates an option with a nullable type that defaults to null.
mkNullOrOption = type: desc:
lib.mkOption {
@ -146,14 +153,7 @@ with lib; rec {
mkEnumFirstDefault = enum: mkEnum enum (head enum);
mkBorder = default: name: desc:
mkNullable
(
with lib.types;
oneOf [
str
(listOf str)
(listOf (listOf str))
]
)
borderType
default
(let
defaultDesc = ''