aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/update_hosts.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/update_hosts.sh9
1 files 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