mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
dece37b83a
Allows the simultaneous construction of top-level invocations and submodule types. This helps structure configuration systems integration code.
28 lines
510 B
Nix
28 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;
|
|
}
|
|
];
|
|
}
|