From 862cd1c7b53247aad994f1ac79dea04708ce4557 Mon Sep 17 00:00:00 2001 From: oddlama Date: Mon, 16 Oct 2023 18:12:49 +0200 Subject: [PATCH] fix(deploy): continue after apply error --- pkgs/deploy.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/deploy.nix b/pkgs/deploy.nix index ddda085..3dc2d5e 100644 --- a/pkgs/deploy.nix +++ b/pkgs/deploy.nix @@ -102,8 +102,10 @@ store_path="''${TOPLEVEL_STORE_PATHS["$host"]}" echo " Applying ⚙️ $host" 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" + ssh "$host" -- /run/current-system/sw/bin/nix-env --profile /nix/var/nix/profiles/system --set "$store_path" \ + || die "Failed to set system profile" + ssh "$host" -- "$store_path"/bin/switch-to-configuration "$ACTION" \ + || echo "Error while activating new system" >&2 if [[ -n "$prev_system" ]]; then ssh "$host" -- nvd --color always diff "$prev_system" "$store_path" fi