mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-19 10:34:54 +00:00

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;
|
|
}
|
|
];
|
|
}
|