core/lib/tests/modules/freeform-submodules.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
531 B
Nix
Raw Normal View History

2024-05-01 22:14:04 +00:00
{ lib, options, ... }:
with lib.types;
{
options.fooDeclarations = lib.mkOption {
default = (options.free.type.getSubOptions [ ])._freeformOptions.foo.declarations;
};
options.free = lib.mkOption {
type = submodule {
config._module.freeformType = lib.mkMerge [
(attrsOf (submodule {
options.foo = lib.mkOption { };
}))
(attrsOf (submodule {
options.bar = lib.mkOption { };
}))
];
};
};
config.free.xxx.foo = 10;
config.free.yyy.bar = 10;
}