diff options
Diffstat (limited to 'lib/tests/modules/optionTypeMerging.nix')
-rw-r--r-- | lib/tests/modules/optionTypeMerging.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/tests/modules/optionTypeMerging.nix b/lib/tests/modules/optionTypeMerging.nix new file mode 100644 index 00000000000..74a620c4620 --- /dev/null +++ b/lib/tests/modules/optionTypeMerging.nix @@ -0,0 +1,27 @@ +{ config, lib, ... }: { + + options.theType = lib.mkOption { + type = lib.types.optionType; + }; + + options.theOption = lib.mkOption { + type = config.theType; + }; + + config.theType = lib.mkMerge [ + (lib.types.submodule { + options.int = lib.mkOption { + type = lib.types.int; + default = 10; + }; + }) + (lib.types.submodule { + options.str = lib.mkOption { + type = lib.types.str; + }; + }) + ]; + + config.theOption.str = "hello"; + +} |