liminix-rebuild: test if nix-build succeeds

This commit is contained in:
Daniel Barlow 2023-05-20 22:30:22 +01:00
parent ea2f48cfc9
commit 39b09df4d7

View file

@ -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