mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-18 11:44:07 +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;
|
|
}
|
|
];
|
|
}
|