lib/tests: Add submoduleWith tests
This commit is contained in:
30
lib/tests/modules/declare-submoduleWith-modules.nix
Normal file
30
lib/tests/modules/declare-submoduleWith-modules.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{ lib, ... }: {
|
||||
options.submodule = lib.mkOption {
|
||||
type = lib.types.submoduleWith {
|
||||
modules = [
|
||||
{
|
||||
options.inner = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
}
|
||||
{
|
||||
outer = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
default = {};
|
||||
};
|
||||
|
||||
config.submodule = lib.mkMerge [
|
||||
({ lib, ... }: {
|
||||
options.outer = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
})
|
||||
{
|
||||
inner = true;
|
||||
}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user