lib/types: Add oneOf, extension of either to a list of types
This commit is contained in:
5
lib/tests/modules/declare-either.nix
Normal file
5
lib/tests/modules/declare-either.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ lib, ... }: {
|
||||
options.value = lib.mkOption {
|
||||
type = lib.types.either lib.types.int lib.types.str;
|
||||
};
|
||||
}
|
||||
9
lib/tests/modules/declare-oneOf.nix
Normal file
9
lib/tests/modules/declare-oneOf.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user