diff --git a/garlic/stages/script.nix b/garlic/stages/script.nix index 4be3cec..292a209 100644 --- a/garlic/stages/script.nix +++ b/garlic/stages/script.nix @@ -5,8 +5,12 @@ { script , shell ? "/bin/sh" +, exitOnError ? true }: +let + setcmd = if exitOnError then "set -e" else ""; +in stdenv.mkDerivation { name = "script"; preferLocalBuild = true; @@ -14,6 +18,7 @@ stdenv.mkDerivation { installPhase = '' cat > $out <<'EOF' #!${shell} + ${setcmd} ${script}