summary refs log tree commit diff
path: root/lib/modules.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-28 15:13:51 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-28 22:45:56 +0100
commitc263b5b284cee4d2b658c6acd2942e367ac3f985 (patch)
tree0543aa1f4e574f1dd340384e0704ce73c71a5127 /lib/modules.nix
parenta40583e7e4eec305a08839df246455b0211dd7d1 (diff)
downloadnixpkgs-c263b5b284cee4d2b658c6acd2942e367ac3f985.tar
nixpkgs-c263b5b284cee4d2b658c6acd2942e367ac3f985.tar.gz
nixpkgs-c263b5b284cee4d2b658c6acd2942e367ac3f985.tar.bz2
nixpkgs-c263b5b284cee4d2b658c6acd2942e367ac3f985.tar.lz
nixpkgs-c263b5b284cee4d2b658c6acd2942e367ac3f985.tar.xz
nixpkgs-c263b5b284cee4d2b658c6acd2942e367ac3f985.tar.zst
nixpkgs-c263b5b284cee4d2b658c6acd2942e367ac3f985.zip
Show error locations in submodules
Diffstat (limited to 'lib/modules.nix')
-rw-r--r--lib/modules.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index f429653d94e..7ad72235994 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -119,7 +119,7 @@ rec {
       if opt.options ? default && res ? default ||
          opt.options ? example && res ? example ||
          opt.options ? description && res ? description ||
-         opt.options ? merge && res ? merge ||
+         opt.options ? merge && res ? merge || # FIXME: remove merge
          opt.options ? apply && res ? apply ||
          opt.options ? type && res ? type
       then
@@ -148,13 +148,13 @@ rec {
           fold (def: res:
             if opt.type.check def.value then res
             else throw "The option value `${showOption loc}' in `${def.file}' is not a ${opt.type.name}.")
-            (opt.type.merge (map (m: m.value) defsFinal)) defsFinal;
+            (opt.type.merge' { prefix = loc; } (map (m: m.value) defsFinal)) defsFinal;
       # Finally, apply the ‘apply’ function to the merged
       # value.  This allows options to yield a value computed
       # from the definitions.
       value = (opt.apply or id) merged;
     in opt //
-      { inherit value;
+      { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
         definitions = defsFinal;
         isDefined = defsFinal != [];
       };