mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-19 00:08:32 +01:00
Merge remote-tracking branch 'shlevy/overridable-functions'
This commit is contained in:
commit
1476240ba6
2 changed files with 9 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
if ! builtins ? nixVersion || builtins.compareVersions "1.7" builtins.nixVersion == 1 then
|
if ! builtins ? nixVersion || builtins.compareVersions "1.8" builtins.nixVersion == 1 then
|
||||||
|
|
||||||
abort "This version of Nixpkgs requires Nix >= 1.7, please upgrade!"
|
abort "This version of Nixpkgs requires Nix >= 1.8, please upgrade!"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,13 @@ rec {
|
||||||
overrideDerivation = fdrv:
|
overrideDerivation = fdrv:
|
||||||
makeOverridable (args: overrideDerivation (f args) fdrv) origArgs;
|
makeOverridable (args: overrideDerivation (f args) fdrv) origArgs;
|
||||||
})
|
})
|
||||||
|
else if builtins.isFunction ff then
|
||||||
|
{ override = newArgs:
|
||||||
|
makeOverridable f (origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs));
|
||||||
|
__functor = self: ff;
|
||||||
|
deepOverride = throw "deepOverride not yet supported for functors";
|
||||||
|
overrideDerivation = throw "overrideDerivation not yet supported for functors";
|
||||||
|
}
|
||||||
else ff;
|
else ff;
|
||||||
|
|
||||||
deepOverrider = newArgs: name: x: if builtins.isAttrs x then (
|
deepOverrider = newArgs: name: x: if builtins.isAttrs x then (
|
||||||
|
|
Loading…
Reference in a new issue