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: recurseInto = name:
moduleMerge (addName name) (modulesOf name); moduleMerge (addName name) (modulesOf name);
recurseForOption = name: modules: recurseForOption = name: modules: args:
moduleMerge name ( moduleMerge name (
map unifyModuleSyntax modules moduleClosure modules args
); );
errorSource = modules: errorSource = modules:

View File

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