From 39b09df4d751ada26de7d770a7014efa1cd83075 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sat, 20 May 2023 22:30:22 +0100 Subject: [PATCH] liminix-rebuild: test if nix-build succeeds --- pkgs/min-copy-closure/liminix-rebuild.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/min-copy-closure/liminix-rebuild.sh b/pkgs/min-copy-closure/liminix-rebuild.sh index 43bb6b6..f13be05 100755 --- a/pkgs/min-copy-closure/liminix-rebuild.sh +++ b/pkgs/min-copy-closure/liminix-rebuild.sh @@ -9,7 +9,11 @@ if [ -z "$target_host" ] ; then exit 1 fi -toplevel=$(nix-build "$@" -A outputs.systemConfiguration --no-out-link) -min-copy-closure $target_host $toplevel -$ssh_command $target_host cp -v -fP $toplevel/bin/* $toplevel/etc/* /persist -$ssh_command $target_host "sync; source /etc/profile; reboot" +if toplevel=$(nix-build "$@" -A outputs.systemConfiguration --no-out-link); then + echo systemConfiguration $toplevel + min-copy-closure $target_host $toplevel + $ssh_command $target_host cp -v -fP $toplevel/bin/* $toplevel/etc/* /persist + $ssh_command $target_host "sync; source /etc/profile; reboot" +else + echo Rebuild failed +fi