about summary refs log tree commit diff stats
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index 357acf58..3c3d387c 100755
--- a/build.sh
+++ b/build.sh
@@ -18,7 +18,21 @@ check() {
     fi
 }
 
-system="$(nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --print-out-paths --no-link)"
+build_system() {
+    _val="$(nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --print-out-paths --no-link)"
+    exit_val="$?"
+
+    if [ "$exit_val" -ne 0 ]; then
+        echo "ERROR: Failed to build you system config for host: '$host'" 1>&2
+        printf 1
+    else
+        printf "%s" "$_val"
+    fi
+}
+
+system="$(build_system)"
+[ "$system" = "1" ] && exit 1
+
 check "$SYSTEM_OUT"
 ln --symbolic "$system" "$SYSTEM_OUT"