summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/modules.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index 55a53b3909a..9c308d347cf 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -115,8 +115,8 @@ rec {
 
       checkUnmatched =
         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
-          let inherit (head merged.unmatchedDefns) file prefix;
-          in throw "The option `${showOption prefix}' defined in `${file}' does not exist."
+          let firstDef = head merged.unmatchedDefns;
+          in throw "The option `${showOption (prefix ++ firstDef.prefix)}' defined in `${firstDef.file}' does not exist."
         else null;
 
       result = builtins.seq checkUnmatched {