Run each experiment in a unique directory

This commit is contained in:
2020-08-10 18:25:53 +02:00
parent 8db4ef2594
commit ef1aeb2cfa
4 changed files with 35 additions and 20 deletions

33
bsc/garlic/launcher.nix Normal file
View File

@@ -0,0 +1,33 @@
{
stdenv
}:
apps:
stdenv.mkDerivation {
name = "launcher";
preferLocalBuild = true;
buildInputs = [] ++ apps;
apps = apps;
phases = [ "installPhase" ];
dontPatchShebangs = true;
installPhase = ''
mkdir -p $out/apps
for j in $apps; do
ln -s $j $out/apps/$(basename $j)
done
mkdir -p $out/bin
cat > $out/bin/run <<EOF
#!/bin/sh
for j in $out/apps/*; do
\$j/bin/run
done
EOF
chmod +x $out/bin/run
'';
}