From f8baace71fcf773125d1cdb1f92865aaf60b73f9 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 14:33:19 +0000 Subject: krops.nix: refuse the enstate action while the profile waits for a reboot The running generation would plan the submissions, and refuse what only the profile's generation has a slot for; the reboot would find nothing to take. --- krops.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/krops.nix b/krops.nix index 322b7724..c4f4975b 100644 --- a/krops.nix +++ b/krops.nix @@ -255,6 +255,13 @@ rec { ${enstateSteps.packAndCopy} ${pkgs.krops.runShell (lib.mkTarget target) {} /* sh */ '' set -efu + # The running generation isn't the profile's (after a deploy with boot, + # or test): it would plan what's meant for the one the next boot runs, + # and refuse what only that one has a slot for. + if [ "$(readlink -f /nix/var/nix/profiles/system)" != "$(readlink -f /run/current-system)" ]; then + echo "${name}: the running generation isn't the system profile's: reboot, or deploy" >&2 + exit 1 + fi ${enstateSteps.movePending} /run/current-system/sw/bin/enstate --migrate ${enstateSteps.showStatus "/run/current-system"} -- cgit v1.3.1