Handle new configuration file argument notation:
{pkgs, config, ...}: svn path=/nixpkgs/trunk/; revision=12753
This commit is contained in:
parent
c967e66ec7
commit
042bc846df
@ -430,13 +430,19 @@ rec {
|
|||||||
# function "merge" which expects two arguments. The attribute named
|
# function "merge" which expects two arguments. The attribute named
|
||||||
# "require" is used to imports option declarations and bindings.
|
# "require" is used to imports option declarations and bindings.
|
||||||
fixOptionSetsFun = merge: pkgs: opts:
|
fixOptionSetsFun = merge: pkgs: opts:
|
||||||
let optionSet = final: configFun:
|
let optionSet = config: configFun:
|
||||||
if __isFunction configFun then configFun pkgs final
|
if __isFunction configFun then
|
||||||
else configFun; # backward compatibility.
|
let result = configFun { inherit pkgs config; }; in
|
||||||
|
# {pkgs, config, ...}: {..}
|
||||||
|
if builtins.isAttrs result then result
|
||||||
|
# pkgs: config: {..}
|
||||||
|
else configFun pkgs config
|
||||||
|
# {..}
|
||||||
|
else configFun;
|
||||||
in
|
in
|
||||||
final: merge ""
|
config: merge ""
|
||||||
(map (x: removeAttrs x ["require"])
|
(map (x: removeAttrs x ["require"])
|
||||||
(uniqFlattenAttr (optionSet final) "require" [] (toList opts))
|
(uniqFlattenAttr (optionSet config) "require" [] (toList opts))
|
||||||
);
|
);
|
||||||
|
|
||||||
fixOptionSets = merge: pkgs: opts:
|
fixOptionSets = merge: pkgs: opts:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user