mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
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:
|
${if ff ? overrideAttrs then "overrideAttrs" else null} = fdrv:
|
||||||
overrideResult (x: x.overrideAttrs fdrv);
|
overrideResult (x: x.overrideAttrs fdrv);
|
||||||
})
|
})
|
||||||
else if lib.isFunction ff then {
|
else if lib.isFunction ff then
|
||||||
override = overrideArgs;
|
# Transform ff into a functor while propagating its arguments
|
||||||
__functor = self: ff;
|
lib.setFunctionArgs ff (lib.functionArgs ff) // {
|
||||||
overrideDerivation = throw "overrideDerivation not yet supported for functors";
|
override = overrideArgs;
|
||||||
}
|
overrideDerivation = throw "overrideDerivation not yet supported for functors";
|
||||||
|
}
|
||||||
else ff;
|
else ff;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user