mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-25 12:22:37 +03:00
lib.mergeModules: Add context to error message
This commit is contained in:
parent
8f700580b9
commit
8014460c4d
@ -565,8 +565,11 @@ let
|
||||
assert
|
||||
lib.all
|
||||
(c:
|
||||
# TODO: I have my doubts that this error would occur when option definitions are not matched.
|
||||
# The implementation of this check used to be tied to a superficially similar check for
|
||||
# options, so maybe that's why this is here.
|
||||
isAttrs c.config || throw ''
|
||||
You're trying to define a value of type `${builtins.typeOf c.config}'
|
||||
In module `${c.file}', you're trying to define a value of type `${builtins.typeOf c.config}'
|
||||
rather than an attribute set for the option
|
||||
`${builtins.concatStringsSep "." prefix}'!
|
||||
|
||||
|
@ -207,7 +207,7 @@ checkConfigOutput '^"foo"$' config.submodule.foo ./declare-submoduleWith-special
|
||||
## shorthandOnlyDefines config behaves as expected
|
||||
checkConfigOutput '^true$' config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-shorthand.nix
|
||||
checkConfigError 'is not of type `boolean' config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-noshorthand.nix
|
||||
checkConfigError "You're trying to define a value of type \`bool'\n\s*rather than an attribute set for the option" config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-shorthand.nix
|
||||
checkConfigError "In module ..*define-submoduleWith-shorthand.nix., you're trying to define a value of type \`bool'\n\s*rather than an attribute set for the option" config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-shorthand.nix
|
||||
checkConfigOutput '^true$' config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-noshorthand.nix
|
||||
|
||||
## submoduleWith should merge all modules in one swoop
|
||||
|
Loading…
Reference in New Issue
Block a user