From 45afe7d391a939694e1667b87cb9617c27d835a8 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Thu, 8 Oct 2020 19:02:18 +0200 Subject: [PATCH] Simplify experiment stage --- .../default.nix => experiment.nix} | 0 garlic/stages/experiment/old.nix | 50 ------------------- garlic/stages/experiment/run | 20 -------- 3 files changed, 70 deletions(-) rename garlic/stages/{experiment/default.nix => experiment.nix} (100%) delete mode 100644 garlic/stages/experiment/old.nix delete mode 100644 garlic/stages/experiment/run diff --git a/garlic/stages/experiment/default.nix b/garlic/stages/experiment.nix similarity index 100% rename from garlic/stages/experiment/default.nix rename to garlic/stages/experiment.nix diff --git a/garlic/stages/experiment/old.nix b/garlic/stages/experiment/old.nix deleted file mode 100644 index 763bdb4..0000000 --- a/garlic/stages/experiment/old.nix +++ /dev/null @@ -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 - ''; -} diff --git a/garlic/stages/experiment/run b/garlic/stages/experiment/run deleted file mode 100644 index 3c98c2c..0000000 --- a/garlic/stages/experiment/run +++ /dev/null @@ -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