From 7353568115ddf653f0d2ff5acce4dfc65258d30e Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Tue, 14 Jul 2026 15:45:00 +0100 Subject: [PATCH] docs(agent): #116 undercounted the phantom reads, and two of them are live bugs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Re-grepped the tree instead of trusting eb38008's own account of it. Two corrections, both in the direction of worse: A fourth read: services.nix:80 `printing.enable`. The original enumeration only looked at options.nix, which is the same mistake in miniature as the bug it was filing — `or` hides a dead bridge, so the only honest check is a grep of all of modules/nixos/, which the item's own pass condition already said and its own list did not do. "Benign today" was wrong about Bluetooth. The TUI control center is shipped (default.nix:337) and reachable from the menu's Control Center row, and its Bluetooth and Printing toggles write settings.bluetooth.enable / settings.printing.enable and print "disabled (requires rebuild)". Nothing reads either key, so the fallback wins and the rebuild changes nothing. Two user-facing toggles that report success and do nothing — that is a live bug, not a dead key. batteryChargeLimit stays benign for the stated reason: its menu patches the baked option instead. nomarchy.settings is declared in exactly one place, modules/home/options.nix: 412 — verified, not assumed. V0: nix flake check --no-build passes. Co-Authored-By: Claude Opus 4.8 --- agent/BACKLOG.md | 58 ++++++++++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/agent/BACKLOG.md b/agent/BACKLOG.md index 44320c7..0b2f03a 100644 --- a/agent/BACKLOG.md +++ b/agent/BACKLOG.md @@ -123,30 +123,46 @@ a suspended machine hibernates after the configured delay and resumes, and a machine without hibernate support hides the row instead of offering a suspend that never wakes. -### 116. Three NixOS options read a `config.nomarchy.settings` that does not exist +### 116. Four NixOS options read a `config.nomarchy.settings` that does not exist — two are live broken toggles -Found while wiring System › Auto-login (2026-07-14). `nomarchy.settings` is -declared and populated **only on the Home Manager side** (`modules/home/ -options.nix`, filled by `theme.nix`). On the NixOS side the attribute is -absent, and `or ` swallows the missing-attribute error — so these -defaults have silently always been their fallback on every machine: +Found while wiring System › Auto-login (2026-07-14); **enumeration corrected +2026-07-14** — the original said "three options … benign today", and both +halves were wrong (see the Bluetooth/Printing rows). -- `nomarchy.system.greeter.autoLogin` — **fixed in this commit** (now reads - the state via `theme-state-read.nix` in `greeter.nix`, the working pattern - from `hardware.nix`/`timezone.nix`). Left here as the worked example. -- `modules/nixos/options.nix` `bluetooth.enable` — `settings.bluetooth.enable` - never read; benign today (fallback `true` = the intended default) but the - state key is dead. -- `modules/nixos/options.nix` `power.batteryChargeLimit` — `settings.power. - batteryChargeLimit` never read; the Battery limit menu works because it - patches the baked option in `system.nix` instead, which is the older model. +`nomarchy.settings` is declared in exactly ONE place — +`modules/home/options.nix:412`, the Home Manager side, filled by `theme.nix`. +On the NixOS side the attribute does not exist at all, and `or ` +swallows the missing-attribute error, so every read below has silently always +been its fallback on every machine ever built: -Decide per option whether the state key should work (wire it like the -greeter) or the phantom read should just go. The trap is that `or` makes both -a live bridge and a dead one look identical — a grep for -`config.nomarchy.settings` under `modules/nixos/` should return nothing when -this is done. Pass = no NixOS option claims a state default it cannot read, -and any bridge kept is proved by an eval that flips with the state file. +- `modules/nixos/greeter.nix` `system.greeter.autoLogin` — **fixed** in + eb38008 (reads the state via `theme-state-read.nix`, the working pattern + from `hardware.nix`/`timezone.nix`). The worked example; copy this shape. +- `modules/nixos/options.nix` `bluetooth.enable` — **live bug, not benign.** + The TUI control center (`nomarchy-control-center.sh:192`, shipped in + `modules/nixos/default.nix:337`, reachable from the rofi menu's "Control + Center" row) has a Bluetooth toggle that writes `settings.bluetooth.enable` + and prints "Bluetooth disabled (requires rebuild)". Nothing reads that key, + so the fallback `true` wins and Bluetooth is still on after the rebuild. + The toggle reports success and does nothing. +- `modules/nixos/services.nix:80` `printing.enable` — **live bug, same shape** + (`nomarchy-control-center.sh:203`). Missed by the original enumeration + entirely, which only looked at `options.nix`. +- `modules/nixos/options.nix:112` `power.batteryChargeLimit` — never read, but + the Battery limit menu works anyway because it patches the baked option in + `system.nix` instead (`modules/home/rofi.nix:342`), the older model. Dead + read, working feature. + +Decide per option whether the state key should work (wire it like the greeter) +or the phantom read should just go — but the two control-center toggles need +one or the other, since today they lie to the user. The trap is that `or` +makes a live bridge and a dead one look identical, which is exactly how the +first pass undercounted: **grep the whole of `modules/nixos/`, not +`options.nix`.** Pass = `grep -rn 'config\.nomarchy\.settings' modules/nixos/` +returns nothing but comments, no NixOS option claims a state default it cannot +read, any bridge kept is proved by an eval that flips with the state file, and +the control-center Bluetooth/Printing toggles are proved to actually change +the built config (or are removed). ### 107. Rename `theme.json` to reflect that it is the system state