fix(deploy): canonicalize previous system toplevel

This commit is contained in:
oddlama 2023-10-15 03:12:41 +02:00
parent e23d78c214
commit 585c6c6f1a
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
2 changed files with 176 additions and 57 deletions

View file

@ -101,7 +101,7 @@
for host in "''${HOSTS[@]}"; do
store_path="''${TOPLEVEL_STORE_PATHS["$host"]}"
echo " Applying  $host"
prev_system=$(ssh "$host" -- readlink /nix/var/nix/profiles/system)
prev_system=$(ssh "$host" -- readlink -e /nix/var/nix/profiles/system)
ssh "$host" -- /run/current-system/sw/bin/nix-env --profile /nix/var/nix/profiles/system --set "$store_path"
ssh "$host" -- "$store_path"/bin/switch-to-configuration "$ACTION"
if [[ -n "$prev_system" ]]; then