diff --git a/agent/BACKLOG.md b/agent/BACKLOG.md index c611493..3300188 100644 --- a/agent/BACKLOG.md +++ b/agent/BACKLOG.md @@ -75,8 +75,13 @@ interplay handled in `modules/nixos/default.nix` / `modules/home/idle.nix`. 1. ~~**Docs** — `docs/MIGRATION.md` hibernation-enable runbook (V0).~~ ✓ shipped 2026-07-10 (§ "Enabling hibernation on an existing machine"; commands verified live against the dev machine's LUKS+@swap layout). -2. **Menu** — Hibernate row: notify-on-failure when no swap configured - (behavioral, V1/V2). Keep the row unconditional. +2. ~~**Menu** — Hibernate row: notify-on-failure when no swap configured.~~ + ✓ shipped 2026-07-10 (`rofi.nix` power arm: `systemctl hibernate || + notify-send …`; success blocks until resume so the notify only fires on + real failure). V1 (HM generation builds; `writeShellScriptBin` bash -n) + + control-flow proof (fail→notify, success→no notify). Row kept unconditional. + The session-level "no-swap pick surfaces a mako notification" is folded + into the V3 laptop check below. 3. **Verify (required)** - **V0:** eval / option / disko contracts. - **V2 (mandatory, agent):** exercise hibernation in the **VM harness** diff --git a/agent/JOURNAL.md b/agent/JOURNAL.md index 42f91fd..9024746 100644 --- a/agent/JOURNAL.md +++ b/agent/JOURNAL.md @@ -17,6 +17,25 @@ Template: --- +## 2026-07-10 — #76 slice 2: Hibernate notify-on-failure +- **Task:** BACKLOG #76 remaining slice 2 — per the settled "keep row, notify + on failure" call. +- **Did:** `modules/home/rofi.nix` power menu Hibernate arm now runs + `systemctl hibernate 2>/dev/null || notify-send "Hibernate" "…see + docs/MIGRATION.md"`. On success the call blocks until resume, so the notify + only fires on a genuine failure (e.g. swap=0 no-swap machine). Row stays + unconditional (no hiding). +- **Verified:** **V1** — `nix build …homeConfigurations.nomarchy.activationPackage` + green (rebuilds `nomarchy-menu.drv`; `writeShellScriptBin` runs bash -n at + build). Control-flow proof on the arm extracted from the built script: + failing `systemctl` → notify fires; succeeding → no notify. `nix flake + check --no-build` green. +- **Pending:** slice 3 = the V2 hibernate→resume VM test + V3 laptop + (Hibernate→power off→resume on the LUKS+@swap machine; plus confirm the + no-swap notify surfaces in a real session). Both remain open on #76. +- **Next suggestion:** slice 3 — add a `checks.*` hibernate VM test (as far + as QEMU allows) and queue the V3 laptop steps in HARDWARE-QUEUE. + ## 2026-07-10 — #76 slice 1: MIGRATION.md hibernation runbook - **Task:** BACKLOG #76 remaining slice 1 — docs runbook for enabling hibernation on an existing machine (per the settled "docs not tool" call). diff --git a/modules/home/rofi.nix b/modules/home/rofi.nix index 4f9dd00..e32fd8d 100644 --- a/modules/home/rofi.nix +++ b/modules/home/rofi.nix @@ -252,7 +252,13 @@ let *Lock) loginctl lock-session ;; *Logout) hyprctl dispatch exit ;; *Suspend) systemctl suspend ;; - *Hibernate) systemctl hibernate ;; + *Hibernate) + # zram can't hold a hibernate image; a machine installed with + # swap=0 has no disk swap. Attempt, and if logind rejects it, + # say why instead of a silent no-op. On success this blocks + # until resume, so the notify only fires on a real failure. + systemctl hibernate 2>/dev/null \ + || notify-send "Hibernate" "Couldn't hibernate — likely no swap is configured. See docs/MIGRATION.md → Enabling hibernation." ;; *Reboot) systemctl reboot ;; *Shutdown) systemctl poweroff ;; esac ;;