summary refs log tree commit diff
path: root/lib/modules.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 12:10:40 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 14:57:42 +0100
commitc7f7ceefd68e3f0204377c5818539bec35330765 (patch)
tree87b093817199bb93e3d507f391f45edde1b6c7b0 /lib/modules.nix
parentac68d326b96b9529ffed2a0100f0d56739cefb96 (diff)
downloadnixpkgs-c7f7ceefd68e3f0204377c5818539bec35330765.tar
nixpkgs-c7f7ceefd68e3f0204377c5818539bec35330765.tar.gz
nixpkgs-c7f7ceefd68e3f0204377c5818539bec35330765.tar.bz2
nixpkgs-c7f7ceefd68e3f0204377c5818539bec35330765.tar.lz
nixpkgs-c7f7ceefd68e3f0204377c5818539bec35330765.tar.xz
nixpkgs-c7f7ceefd68e3f0204377c5818539bec35330765.tar.zst
nixpkgs-c7f7ceefd68e3f0204377c5818539bec35330765.zip
Export only the files of the active definitions
Diffstat (limited to 'lib/modules.nix')
-rw-r--r--lib/modules.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index 6f56d174397..11a2f64799f 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -153,6 +153,7 @@ rec {
       # value specified in the option declaration (if any).
       defsFinal = filterOverrides'
         ((if opt ? default then [{ file = head opt.declarations; value = mkOptionDefault opt.default; }] else []) ++ defs);
+      files = map (def: def.file) defsFinal;
       # Type-check the remaining definitions, and merge them if
       # possible.
       merged =
@@ -162,16 +163,16 @@ 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 { prefix = loc; files = map (m: m.file) defsFinal; } (map (m: m.value) defsFinal)) defsFinal;
+            (opt.type.merge { prefix = loc; inherit files; } (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 //
       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
-        files = map (def: def.file) defs;
         definitions = map (def: def.value) defsFinal;
         isDefined = defsFinal != [];
+        inherit files;
       };
 
   /* Given a config set, expand mkMerge properties, and push down the