From c7f7ceefd68e3f0204377c5818539bec35330765 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 30 Oct 2013 12:10:40 +0100 Subject: [PATCH] Export only the files of the active definitions --- lib/modules.nix | 5 +++-- 1 file 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