feat(menu): #76 slice 2 — Hibernate notifies on failure
All checks were successful
Check / eval (push) Successful in 4m7s

Per the settled #76 UX call: keep the Power-menu Hibernate row
unconditional, but when hibernate fails (typically a swap=0 machine with
no disk swap), surface a notification pointing at the enable-hibernation
runbook instead of a silent no-op. On success `systemctl hibernate`
blocks until resume, so the notify only fires on a real failure.

Verification: V1 — homeConfigurations.nomarchy.activationPackage builds
(rebuilds nomarchy-menu; writeShellScriptBin runs bash -n). Control-flow
proved on the arm extracted from the built script: failing systemctl ->
notify fires, succeeding -> no notify. flake check --no-build green.
V2 hibernate->resume VM test + V3 laptop remain open (#76 slice 3).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-07-10 19:36:52 +01:00
parent 8c048a2692
commit 2d0cb48d5c
3 changed files with 33 additions and 3 deletions

View File

@@ -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**