Simplify experiment stage

This commit is contained in:
Rodrigo Arias 2020-10-08 19:02:18 +02:00
parent d599b8c52f
commit 45afe7d391
3 changed files with 0 additions and 70 deletions

View File

@ -1,50 +0,0 @@
{
stdenv
, nixPrefix ? ""
}:
apps: # Each app must be unique
stdenv.mkDerivation {
name = "launcher";
preferLocalBuild = true;
buildInputs = [] ++ apps;
apps = apps;
phases = [ "unpackPhase" "patchPhase" "installPhase" ];
dontPatchShebangs = true;
programPath = "/bin/run";
src = ./.;
inherit nixPrefix;
patchPhase = ''
substituteAllInPlace run
'';
installPhase = ''
mkdir -p $out/apps
for j in $apps; do
target=$out/apps/$(basename $j)
if [ -e $target ]; then
echo "Duplicated app: $j"
echo
echo "Provided apps: "
printf "%s\n" $apps
echo
exit 1
fi
ln -s $j $target
done
mkdir -p $out/bin
install -m755 run $out/bin/run
chmod +x $out/bin/*
# Mark the launcher for upload
touch $out/.upload-to-mn
# And mark it as an experiment
touch $out/.experiment
'';
}

View File

@ -1,20 +0,0 @@
#!/bin/sh -ex
>&2 echo "Running launcher"
if [ ! -e "/nix" ]; then
>&2 echo "missing /nix"
exit 1
fi
if [ -z "$GARLIC_OUT" ]; then
>&2 echo "GARLIC_OUT is not set"
exit 1
fi
mkdir -p "$GARLIC_OUT"
cd "$GARLIC_OUT"
for j in @out@/apps/*; do
$j/bin/run
done