nixpkgs/lib/tests/modules/declare-bare-submodule-nested-option.nix
Robert Hensing d030e2109f lib.modules: Let module declare options directly in bare submodule
... where a bare submodule is an option that has a type like
`submoduleWith x`, as opposed to `attrsOf (submoduleWith x)`.

This makes migration unnecessary when introducing a freeform type
in an existing option tree.

Closes #146882
2022-03-03 00:28:35 +01:00

19 lines
293 B
Nix

{ lib, ... }:
let
inherit (lib) mkOption types;
in
{
options.bare-submodule = mkOption {
type = types.submoduleWith {
modules = [
{
options.nested = mkOption {
type = types.int;
default = 1;
};
}
];
};
};
}