fix(snapshots): un-break the GUI — polkit agent + launcher, not an override
All checks were successful
Check / eval (push) Successful in 3m4s

Re-diagnosis of the "btrfs-assistant 2.2 segfaults on launch" bug, and
the fix is not the planned nixpkgs override:

1. gdb: the crash is btrfs_util_subvolume_iterator_next() —
   libbtrfsutil's UNPRIVILEGED subvolume-iteration path in btrfs-progs
   6.17.1 (upstream-fixed after 6.17.1, kdave/btrfs-progs 886571653).
   Symbol versions were checked and match: not ABI/link drift.
2. VM A/B on real btrfs: as root it works (exit 0); as a user it
   segfaults (139). The pkexec launcher runs it as root — so the GUI
   path was fine all along, except…
3. …the distro shipped NO polkit authentication agent: every pkexec
   prompt in the session failed silently. That is the actual root
   cause of "the GUI doesn't open".

Shipped: hyprpolkitagent (Hyprland's Qt agent — the prompt is
Stylix-themed) via exec-once in hyprland.nix; `nomarchy-menu snapshot`
prefers btrfs-assistant-launcher again, with the nomarchy-snapshots
fzf flow kept as fallback (and for SSH); checks.snapshot-gui guards
the root path + offscreen GUI event loop on a real btrfs volume so a
lock bump can't silently regress it. No btrfs-progs patch: all our
flows are root-side; the unprivileged fix arrives with a lock bump.

Verified: V0 (flake check) + V2 (snapshot-gui check, executed green) +
V1 (HM generation builds; hyprland.conf carries the agent exec-once;
generated menu passes bash -n with the launcher wiring). Remaining V3
queued: first on-hardware themed polkit prompt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-07-04 10:07:40 +01:00
parent baab2d3b88
commit a47aa3aff5
9 changed files with 107 additions and 34 deletions

View File

@@ -22,16 +22,6 @@ next, in what order*.
## NOW
### 4. btrfs-assistant segfault — attempt the nixpkgs override fix
ROADMAP § Snapshot browse/restore. btrfs-assistant 2.2 crashes in
`libbtrfsutil.so.1.4.0` (ABI mismatch, confirmed not a VM artifact); the
`nomarchy-snapshots` fzf fallback ships. Try an override aligning its
libbtrfsutil (or a version bump/pin); if upstream nixpkgs has since
fixed it, just verify and re-point the menu. **Done when:** the GUI
launches in the VM test, or the attempt is written up as infeasible
(then re-check on each lock bump). **Verify:** V2 — extend the snapper
VM check to launch the binary.
### 5. Keyboard layouts — cycle bind + summer-bar parity
ROADMAP § Keyboard layouts, remaining bullets: (a) a multi-layout cycle
bind (`hyprctl switchxkblayout` current-device, or xkb `grp:` option)

View File

@@ -25,9 +25,14 @@ QA machine), the **T14s** (webcam case).
plug an external keyboard post-login, pick a layout in rofi, confirm
it applies per-device only, persists in `settings.keyboard.devices`,
and graduates into a `device{}` block on the next rebuild.
- [ ] **Snapshots restore/rollback** — `nomarchy-menu snapshot`
`nomarchy-snapshots`: browse/diff, restore a file (`undochange`),
and a root-config rollback, each behind the typed-`yes` gate.
- [ ] **Snapshots restore/rollback** — `nomarchy-menu snapshot` now opens
the **btrfs-assistant GUI**: a *themed* polkit prompt must appear
(hyprpolkitagent — first on-hardware outing) and the GUI must open
as root. Also exercise the fzf fallback in a terminal
(`sudo nomarchy-snapshots`): browse/diff, restore a file
(`undochange`), and a root-config rollback behind the typed-`yes`
gate. Bonus check: any other pkexec flow now prompts instead of
silently failing.
- [ ] **Update awareness** — with `nomarchy.updates.enable`, let the timer
fire (or start the unit): indicator appears only when inputs are
behind, notification only on count growth, click opens the upgrade

View File

@@ -17,6 +17,24 @@ Template:
---
## 2026-07-04 — Snapshot GUI un-broken + polkit agent (loop iteration #4)
- **Task:** BACKLOG NOW#4 — btrfs-assistant segfault.
- **Did:** re-diagnosed instead of overriding. gdb: crash is in
libbtrfsutil's *unprivileged* subvolume iteration (btrfs-progs 6.17.1;
upstream fix `886571653` post-6.17.1; symbol versions verified — not
ABI drift). VM A/B: root works (exit 0), user crashes (139). The
launcher runs it as root → GUI fine *if* pkexec can prompt — and the
distro shipped **no polkit agent** (all pkexec silently failed; the
actual root cause of "GUI is dead"). Shipped: hyprpolkitagent
(exec-once, Stylix-themed Qt), menu re-pointed to the launcher with
the fzf flow as fallback, `checks.snapshot-gui` canary (root path +
offscreen event loop on real btrfs). No btrfs-progs patch — root-side
flows don't hit the bug; the fix arrives with a lock bump.
- **Verified:** V0 + V2 (snapshot-gui check, run for real) + V1 (HM
generation renders the agent exec-once; menu bash -n).
- **Pending:** V3 queued — first on-hardware themed polkit prompt.
- **Next suggestion:** NOW#5 (keyboard cycle bind + summer parity).
## 2026-07-04 — CI is green (run #58) — item 20 main half closed
- **Task:** monitor follow-up, no code. Run #58 (the .gitea path fix)
**succeeded** — first green CI: the container recipe works on the

View File

@@ -31,10 +31,14 @@ iteration would otherwise rediscover.
- No KVM = slow, not broken; don't read slowness as failure.
## Known-broken / watchlist
- **btrfs-assistant 2.2 segfaults on launch** (nixpkgs 26.05,
`libbtrfsutil.so.1.4.0` ABI mismatch; crashes on hardware too, not a VM
artifact). `nomarchy-snapshots` fzf flow is the shipped fallback;
re-check on every lock bump (§ Snapshot browse/restore; BACKLOG NOW#2).
- **btrfs-assistant "segfault" was unprivileged-only** (re-diagnosed
2026-07-04): libbtrfsutil's unprivileged subvolume iteration crashes on
btrfs-progs 6.17.1 (upstream-fixed after); **as root it works**, and the
pkexec launcher runs it as root. The real distro bug was **no polkit
agent in the session** (every pkexec failed silently) — hyprpolkitagent
now ships (hyprland.nix exec-once). `checks.snapshot-gui` guards the
root path. Lesson: before "app X is broken", check WHO it runs as — and
whether polkit prompts can render at all (§ Snapshot browse/restore).
- **NixOS release bump is a trap:** the discarded attempt
(branch deleted 2026-06-22) hit a Hyprland OOM blocker; a redo is a
deliberate `v2`, never part of routine lock bumps.