modules: Enable setting extraArgs for all submodules or by name
Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
parent
6509d2cb2c
commit
888c7f2757
@ -90,10 +90,17 @@ rec {
|
|||||||
# Evaluate sub-modules.
|
# Evaluate sub-modules.
|
||||||
subModuleMerge = path: vals:
|
subModuleMerge = path: vals:
|
||||||
lib.fix (args:
|
lib.fix (args:
|
||||||
let result = recurseInto path (optionConfig vals args); in {
|
let
|
||||||
inherit (result) config options;
|
result = recurseInto path (optionConfig vals args);
|
||||||
name = lib.removePrefix (opt.name + ".") path;
|
name = lib.removePrefix (opt.name + ".") path;
|
||||||
}
|
extraArgs = opt.extraArgs or {};
|
||||||
|
individualExtraArgs = opt.individualExtraArgs or {};
|
||||||
|
in {
|
||||||
|
inherit (result) config options;
|
||||||
|
inherit name;
|
||||||
|
} //
|
||||||
|
(opt.extraArgs or {}) //
|
||||||
|
(if hasAttr name individualExtraArgs then getAttr name individualExtraArgs else {})
|
||||||
);
|
);
|
||||||
|
|
||||||
# Add _options in sub-modules to make it viewable from other
|
# Add _options in sub-modules to make it viewable from other
|
||||||
|
Loading…
Reference in New Issue
Block a user