forked from mirrors/nixpkgs
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.
|
||||
subModuleMerge = path: vals:
|
||||
lib.fix (args:
|
||||
let result = recurseInto path (optionConfig vals args); in {
|
||||
inherit (result) config options;
|
||||
let
|
||||
result = recurseInto path (optionConfig vals args);
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue