From 95fb70056cd5c6479961271707e66a4f1305223e Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 18 Jul 2026 13:56:22 +0200 Subject: scripts/update_hosts.sh: Use faster `nix copy` and ping hosts after update --- scripts/update_hosts.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/update_hosts.sh b/scripts/update_hosts.sh index 505f061..cc459ed 100755 --- a/scripts/update_hosts.sh +++ b/scripts/update_hosts.sh @@ -10,10 +10,8 @@ branch="${3-main}" for host in $hosts; do echo "Updating '$user@$host.vhack.eu' ..." - new_system="$(nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --no-link --print-out-paths)" - printf "Copying closure ..\n" - nix-copy-closure "$user@$host.vhack.eu" "$new_system" + nix copy --substitute-on-destination --to "ssh://$user@$host.vhack.eu" ".#nixosConfigurations.$host.config.system.build.toplevel" printf "Deploying remote side script ..\n" scp "$base_dir/scripts/update_hosts.remote" "$user@$host.vhack.eu:update_host.remote" @@ -21,4 +19,9 @@ for host in $hosts; do printf "Executing remote side script ..\n" ssh -t "$user@$host.vhack.eu" "chmod +x update_host.remote; ./update_host.remote '$branch'" done + +# Give the servers some time to reboot +sleep 5 +ping_hosts.sh + # vim: ft=sh -- cgit v1.3.1