tools: recursive getExperiment
It allows getExperimentStage to be called from any stage above the experiment.
This commit is contained in:
parent
d192a59fdc
commit
8bc5656461
@ -24,6 +24,8 @@ stdenv.mkDerivation {
|
|||||||
dontPatchShebangs = true;
|
dontPatchShebangs = true;
|
||||||
inherit units;
|
inherit units;
|
||||||
|
|
||||||
|
isExperiment = true;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
cat > $out << EOF
|
cat > $out << EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
@ -40,7 +40,9 @@ let
|
|||||||
else "${stage}";
|
else "${stage}";
|
||||||
|
|
||||||
/* Given a trebuchet, returns the experiment */
|
/* Given a trebuchet, returns the experiment */
|
||||||
getExperimentStage = drv: drv.nextStage.nextStage.nextStage;
|
getExperimentStage = drv:
|
||||||
|
if (drv ? isExperiment) && drv.isExperiment then drv
|
||||||
|
else getExperimentStage drv.nextStage;
|
||||||
|
|
||||||
# Computes the exponentiation operation
|
# Computes the exponentiation operation
|
||||||
pow = x: n: fold (a: b: a*b) 1 (map (a: x) (range 1 n));
|
pow = x: n: fold (a: b: a*b) 1 (map (a: x) (range 1 n));
|
||||||
|
Loading…
Reference in New Issue
Block a user