diff --git a/shell.nix b/shell.nix
index d67b7181bee5f156a67b10eb3f833d742acc8ca5..a9a4194b568db741d9922ad09c59891ea1b5d838 100644
--- a/shell.nix
+++ b/shell.nix
@@ -54,6 +54,8 @@ let
 
   build = pkgs.writeShellScriptBin "build" ''
     #!/usr/bin/env bash
+    set -e
+
     echo "Compiling"
     build-purs-from-store
     echo "Bundling"