forked from mirrors/nixpkgs
lib/makeOverridable: Propagate function args of the callPackage'd function
This allows querying function arguments of things like fetchFromGitHub: nix-repl> lib.functionArgs pkgs.fetchFromGitHub { fetchSubmodules = true; githubBase = true; ... }
This commit is contained in:
parent
d54bdf5504
commit
c638dac226
|
@ -82,11 +82,12 @@ rec {
|
|||
${if ff ? overrideAttrs then "overrideAttrs" else null} = fdrv:
|
||||
overrideResult (x: x.overrideAttrs fdrv);
|
||||
})
|
||||
else if lib.isFunction ff then {
|
||||
override = overrideArgs;
|
||||
__functor = self: ff;
|
||||
overrideDerivation = throw "overrideDerivation not yet supported for functors";
|
||||
}
|
||||
else if lib.isFunction ff then
|
||||
# Transform ff into a functor while propagating its arguments
|
||||
lib.setFunctionArgs ff (lib.functionArgs ff) // {
|
||||
override = overrideArgs;
|
||||
overrideDerivation = throw "overrideDerivation not yet supported for functors";
|
||||
}
|
||||
else ff;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue