From 6ab448b10a5c19caef1b4d548845525a5c3d3a77 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 9 Oct 2020 20:28:00 +0200 Subject: [PATCH] Fix trebuchet description --- garlic/stages/experiment.nix | 15 ++------------- garlic/stages/isolate/default.nix | 1 + garlic/stages/trebuchet.nix | 10 +++++++--- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/garlic/stages/experiment.nix b/garlic/stages/experiment.nix index f59f590..50ee2be 100644 --- a/garlic/stages/experiment.nix +++ b/garlic/stages/experiment.nix @@ -1,5 +1,6 @@ { stdenv +, garlicTools }: { @@ -7,20 +8,11 @@ }: with stdenv.lib; +with garlicTools; let - stageProgram = stage: - if stage ? programPath - then "${stage}${stage.programPath}" else "${stage}"; - unitsString = builtins.concatStringsSep "\n" (map (x: "${stageProgram x}") units); - - desc = builtins.concatStringsSep "\n" - (map (x: '' - # ${x} - ${x.desc}'') units); - in stdenv.mkDerivation { name = "experiment"; @@ -28,14 +20,11 @@ stdenv.mkDerivation { preferLocalBuild = true; dontPatchShebangs = true; inherit units; - inherit desc; installPhase = '' cat > $out << EOF #!/bin/sh - ${desc} - # This is an experiment formed by the following units: ${unitsString} EOF diff --git a/garlic/stages/isolate/default.nix b/garlic/stages/isolate/default.nix index a373db6..dc074e1 100644 --- a/garlic/stages/isolate/default.nix +++ b/garlic/stages/isolate/default.nix @@ -21,6 +21,7 @@ stdenv.mkDerivation { dontPatchShebangs = true; programPath = "/bin/stage1"; inherit nixPrefix clusterName nixtools busybox; + inherit nextStage; program = stageProgram nextStage; desc = "# $out\n" + (if builtins.hasAttr "desc" nextStage then nextStage.desc else ""); out = "$out"; diff --git a/garlic/stages/trebuchet.nix b/garlic/stages/trebuchet.nix index ff8e6f1..113b154 100644 --- a/garlic/stages/trebuchet.nix +++ b/garlic/stages/trebuchet.nix @@ -13,14 +13,17 @@ , targetCluster ? "mn4" }: +with garlicTools; + let - program = garlicTools.stageProgram nextStage; + program = stageProgram nextStage; in stdenv.mkDerivation { name = "trebuchet"; phases = [ "installPhase" ]; preferLocalBuild = true; dontPatchShebangs = true; + inherit nextStage; installPhase = '' cat > $out <