lib/types: Add oneOf, extension of either to a list of types

This commit is contained in:
Silvan Mosberger
2019-08-01 15:55:33 +02:00
parent c6e7bc2977
commit 9a44f44d4c
5 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
{ lib, ... }: {
options.value = lib.mkOption {
type = lib.types.either lib.types.int lib.types.str;
};
}

View File

@@ -0,0 +1,9 @@
{ lib, ... }: {
options.value = lib.mkOption {
type = lib.types.oneOf [
lib.types.int
(lib.types.listOf lib.types.int)
lib.types.str
];
};
}