diff options
author | Robert Hensing <robert@roberthensing.nl> | 2022-05-18 18:46:35 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2022-06-14 23:01:26 +0200 |
commit | a2c29561e722e9546c61323a91f9faffcc3bf268 (patch) | |
tree | e3c13824f3b07e3d703014ba5925ff61bae90dd6 /lib | |
parent | 38b7709a6f02ea33fe67220b7ff14fb21ab08e14 (diff) |
lib.types.deferredModule: Improve reported location
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/tests/modules.sh | 2 | ||||
-rw-r--r-- | lib/types.nix | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index 155d7e5fa3d22..29f6272ea50aa 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -198,7 +198,7 @@ checkConfigOutput '^true$' config.submodule.enable ./declare-submoduleWith-path. # default module is merged into nodes.foo checkConfigOutput '"beta"' config.nodes.foo.settingsDict.c ./deferred-module.nix # errors from the default module are reported with accurate location -checkConfigError 'In `default from the-file-that-contains-the-bad-config.nix'\'': "bogus"' config.nodes.foo.bottom ./deferred-module.nix +checkConfigError 'In `the-file-that-contains-the-bad-config.nix, via option default'\'': "bogus"' config.nodes.foo.bottom ./deferred-module.nix # Check the file location information is propagated into submodules checkConfigOutput the-file.nix config.submodule.internalFiles.0 ./submoduleFiles.nix diff --git a/lib/types.nix b/lib/types.nix index 22a3292644572..83882179d06d5 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -544,7 +544,7 @@ rec { name = "deferredModule"; description = "module"; check = t: isAttrs t || isFunction t; - merge = loc: defs: map (def: lib.setDefaultModuleLocation "${showOption loc} from ${def.file}" def.value) defs; + merge = loc: defs: map (def: lib.setDefaultModuleLocation "${def.file}, via option ${showOption loc}" def.value) defs; }; # The type of a type! |