lib/modules: Fix freeform modules when there's no definitions
This commit is contained in:
parent
446d80d28d
commit
e0ded8f4ba
@ -104,7 +104,8 @@ rec {
|
|||||||
file = def.file;
|
file = def.file;
|
||||||
value = setAttrByPath def.prefix def.value;
|
value = setAttrByPath def.prefix def.value;
|
||||||
}) merged.unmatchedDefns;
|
}) merged.unmatchedDefns;
|
||||||
in declaredConfig._module.freeformType.merge prefix defs;
|
in if defs == [] then {}
|
||||||
|
else declaredConfig._module.freeformType.merge prefix defs;
|
||||||
|
|
||||||
in if declaredConfig._module.freeformType == null then declaredConfig
|
in if declaredConfig._module.freeformType == null then declaredConfig
|
||||||
# Because all definitions that had an associated option ended in
|
# Because all definitions that had an associated option ended in
|
||||||
|
@ -213,6 +213,8 @@ checkConfigError 'The option value .* in .* is not of type .*' \
|
|||||||
## Freeform modules
|
## Freeform modules
|
||||||
# Assigning without a declared option should work
|
# Assigning without a declared option should work
|
||||||
checkConfigOutput 24 config.value ./freeform-attrsOf.nix ./define-value-string.nix
|
checkConfigOutput 24 config.value ./freeform-attrsOf.nix ./define-value-string.nix
|
||||||
|
# No freeform assigments shouldn't make it error
|
||||||
|
checkConfigOutput '{ }' config ./freeform-attrsOf.nix
|
||||||
# but only if the type matches
|
# but only if the type matches
|
||||||
checkConfigError 'The option value .* in .* is not of type .*' config.value ./freeform-attrsOf.nix ./define-value-list.nix
|
checkConfigError 'The option value .* in .* is not of type .*' config.value ./freeform-attrsOf.nix ./define-value-list.nix
|
||||||
# and properties should be applied
|
# and properties should be applied
|
||||||
|
Loading…
Reference in New Issue
Block a user