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;
|
||||
inherit units;
|
||||
|
||||
isExperiment = true;
|
||||
|
||||
installPhase = ''
|
||||
cat > $out << EOF
|
||||
#!/bin/sh
|
||||
|
@ -40,7 +40,9 @@ let
|
||||
else "${stage}";
|
||||
|
||||
/* 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
|
||||
pow = x: n: fold (a: b: a*b) 1 (map (a: x) (range 1 n));
|
||||
|
Loading…
Reference in New Issue
Block a user