diff options
author | Silvan Mosberger <infinisil@icloud.com> | 2019-08-01 15:55:33 +0200 |
---|---|---|
committer | Silvan Mosberger <infinisil@icloud.com> | 2019-08-06 14:08:42 +0200 |
commit | 9a44f44d4c0d33775b63ad9dd387fd77f810074e (patch) | |
tree | 36292691567b9951c21260b1714654565898a49d /lib/tests/modules | |
parent | c6e7bc2977f728efcecfb954bbb38d436e98b798 (diff) |
lib/types: Add oneOf, extension of either to a list of types
Diffstat (limited to 'lib/tests/modules')
-rw-r--r-- | lib/tests/modules/declare-either.nix | 5 | ||||
-rw-r--r-- | lib/tests/modules/declare-oneOf.nix | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/tests/modules/declare-either.nix b/lib/tests/modules/declare-either.nix new file mode 100644 index 000000000000..5a0fa978a138 --- /dev/null +++ b/lib/tests/modules/declare-either.nix @@ -0,0 +1,5 @@ +{ lib, ... }: { + options.value = lib.mkOption { + type = lib.types.either lib.types.int lib.types.str; + }; +} diff --git a/lib/tests/modules/declare-oneOf.nix b/lib/tests/modules/declare-oneOf.nix new file mode 100644 index 000000000000..df092a14f81e --- /dev/null +++ b/lib/tests/modules/declare-oneOf.nix @@ -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 + ]; + }; +} |