summaryrefslogtreecommitdiffstats
path: root/lib/customisation.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-28 21:23:24 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-28 21:42:25 +0200
commit314e8e49ecbfd4136463eff782190035d1b07365 (patch)
tree76ad19c8e4483fa7a09e06ef19cd640199fd6667 /lib/customisation.nix
parent2bc305c1c64bea1def647bad27c00391539f11ba (diff)
Remove deepOverride
It's unused, and also a bad idea: because it recursively recomputes every function argument and there is no sharing, you can get an exponential (?) blowup in evaluation time. For example, evaluating ‘linuxPackages.kernel’ takes 0.09s and ~13 MiB, but evaluating ‘linuxPackages.kernel.deepOverride {}’ takes 3.6s and ~305 MiB.
Diffstat (limited to 'lib/customisation.nix')
-rw-r--r--lib/customisation.nix12
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix
index 91a25055df29..b3c73c39be41 100644
--- a/lib/customisation.nix
+++ b/lib/customisation.nix
@@ -49,10 +49,6 @@ rec {
else { }));
- # usage: (you can use override multiple times)
- # let d = makeOverridable stdenv.mkDerivation { name = ..; buildInputs; }
- # noBuildInputs = d.override { buildInputs = []; }
- # additionalBuildInputs = d.override ( args : args // { buildInputs = args.buildInputs ++ [ additional ]; } )
makeOverridable = f: origArgs:
let
ff = f origArgs;
@@ -60,24 +56,16 @@ rec {
in
if builtins.isAttrs ff then (ff //
{ override = newArgs: makeOverridable f (overrideWith newArgs);
- deepOverride = newArgs:
- makeOverridable f (lib.overrideExisting (lib.mapAttrs (deepOverrider newArgs) origArgs) newArgs);
overrideDerivation = fdrv:
makeOverridable (args: overrideDerivation (f args) fdrv) origArgs;
})
else if builtins.isFunction ff then
{ override = newArgs: makeOverridable f (overrideWith newArgs);
__functor = self: ff;
- deepOverride = throw "deepOverride not yet supported for functors";
overrideDerivation = throw "overrideDerivation not yet supported for functors";
}
else ff;
- deepOverrider = newArgs: name: x: if builtins.isAttrs x then (
- if x ? deepOverride then (x.deepOverride newArgs) else
- if x ? override then (x.override newArgs) else
- x) else x;
-
/* Call the package function in the file `fn' with the required
arguments automatically. The function is called with the