bscpkgs/garlic/stages/control.nix
Rodrigo Arias Mallo 4beb069627 WIP: postprocessing pipeline
Now each run is executed in a independent folder
2020-11-03 19:09:59 +01:00

31 lines
427 B
Nix

{
stdenv
, garlicTools
}:
{
nextStage
, loops ? 30
}:
with garlicTools;
stdenv.mkDerivation {
name = "control";
preferLocalBuild = true;
phases = [ "installPhase" ];
dontPatchShebangs = true;
installPhase = ''
cat > $out <<EOF
#!/bin/sh
for n in \$(seq 1 ${toString loops}); do
mkdir "\$n"
cd "\$n"
${stageProgram nextStage}
cd ..
done
EOF
chmod +x $out
'';
}