chore: simplify deploy output

This commit is contained in:
oddlama 2023-09-25 23:23:31 +02:00
parent a4365be29f
commit 79ef3f7805
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A

View file

@ -83,28 +83,28 @@
declare -A TOPLEVEL_STORE_PATHS
for host in "''${HOSTS[@]}"; do
toplevel="''${TOPLEVEL_FLAKE_PATHS["$host"]}"
echo " Building 📦 configuration for $host"
echo " Building 📦 $host"
TOPLEVEL_STORE_PATHS["$host"]=$(nix build --no-link --print-out-paths "''${OPTIONS[@]}" "$toplevel") \
|| die "Failed to get derivation path for $host from ''${TOPLEVEL_FLAKE_PATHS["$host"]}"
time_next
echo " Built  configuration for $host in ''${T_LAST}s"
echo " Built  $host ''${TOPLEVEL_STORE_PATHS["$host"]} in ''${T_LAST}s"
done
for host in "''${HOSTS[@]}"; do
store_path="''${TOPLEVEL_STORE_PATHS["$host"]}"
echo " Copying  to $host"
echo " Copying  $host"
nix copy --to "ssh-ng://$host" "$store_path"
time_next
echo " Copied  $store_path to $host in ''${T_LAST}s"
echo " Copied  $host in ''${T_LAST}s"
done
for host in "''${HOSTS[@]}"; do
store_path="''${TOPLEVEL_STORE_PATHS["$host"]}"
echo " Applying  on $host"
echo " Applying  $host"
ssh "$host" -- "$store_path"/bin/switch-to-configuration "$ACTION"
nix copy --to "ssh-ng://$host" "$store_path"
time_next
echo " Applied  on $host in ''${T_LAST}s"
echo " Applied  $host in ''${T_LAST}s"
done
'';
};