Allow imports in submodules

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-06-06 13:59:26 -04:00
parent bc409a6e00
commit d465d6764a
2 changed files with 3 additions and 8 deletions

View File

@ -197,9 +197,9 @@ rec {
recurseInto = name:
moduleMerge (addName name) (modulesOf name);
recurseForOption = name: modules:
recurseForOption = name: modules: args:
moduleMerge name (
map unifyModuleSyntax modules
moduleClosure modules args
);
errorSource = modules:

View File

@ -82,16 +82,11 @@ rec {
handleOptionSets = opt:
if opt ? type && opt.type.hasOptions then
let
optionConfig = vals: args:
map (f: lib.applyIfFunction f args)
(opt.options ++ toList vals);
# Evaluate sub-modules.
subModuleMerge = path: vals:
lib.fix (args:
let
result = recurseInto path (optionConfig vals args);
result = recurseInto path (opt.options ++ toList vals) args;
name = lib.removePrefix (opt.name + ".") path;
extraArgs = opt.extraArgs or {};
individualExtraArgs = opt.individualExtraArgs or {};