mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
lib.modules: submodule emptyValue must evaluate sub-option defaults
`emptyValue` for `types.submodule` was `{ value = { }; }`, i.e. none
of the type-declared options or their defaults.
Previously submodules without defs would simply fail for lack of a default,
but since PR #500104 repurposed `emptyValue` as the fallback when no
definitions exist, submodule options without an explicit `default = { }`
(new additions) silently lost their sub-option defaults
(e.g. `requiredFeatures.devnet` in the nixos-test-driver, #511413).
Main change: `emptyValue`: `{ }` -> `{ value = base.config; }`
Additionally, skip `emptyValue`-based default rendering in docs for
types with submodules, because their sub-options are already documented
individually, and forcing evaluation here can break on modules with
invalid or incomplete definitions.
This commit is contained in:
parent
d24dbb1951
commit
77b5864637
4 changed files with 37 additions and 3 deletions
|
|
@ -1320,7 +1320,7 @@ rec {
|
|||
};
|
||||
};
|
||||
emptyValue = {
|
||||
value = { };
|
||||
value = base.config;
|
||||
};
|
||||
getSubOptions =
|
||||
prefix:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue