mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
dece37b83a
Allows the simultaneous construction of top-level invocations and submodule types. This helps structure configuration systems integration code.
29 lines
510 B
Nix
29 lines
510 B
Nix
{ lib, ... }: {
|
|
options.submodule = lib.mkOption {
|
|
inherit (lib.evalModules {
|
|
modules = [
|
|
{
|
|
options.inner = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
};
|
|
}
|
|
];
|
|
}) type;
|
|
default = {};
|
|
};
|
|
|
|
config.submodule = lib.mkMerge [
|
|
({ lib, ... }: {
|
|
options.outer = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
};
|
|
})
|
|
{
|
|
inner = true;
|
|
outer = true;
|
|
}
|
|
];
|
|
}
|