2020-08-11 12:05:43 +02:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
}:
|
|
|
|
|
|
|
|
program:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit program;
|
|
|
|
name = "${program.name}-control";
|
|
|
|
preferLocalBuild = true;
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
dontPatchShebangs = true;
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cat > $out/bin/run <<EOF
|
|
|
|
#!/bin/sh
|
2020-08-25 18:35:58 +02:00
|
|
|
set -e
|
2020-08-11 12:05:43 +02:00
|
|
|
for n in {1..30}; do
|
|
|
|
$program/bin/run
|
|
|
|
done
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/run
|
|
|
|
'';
|
|
|
|
}
|