fix(neogaia): replace guessed hardware detection with a real scan (task 0017) #2

Merged
alexion merged 6 commits from task-0017-hardware-detection-refresh into main 2026-07-19 23:12:42 -04:00
Owner

Task: .claude/tasks/0017-hardware-detection-refresh.md

hosts/neogaia/hardware-configuration.nix was written before this machine ran NixOS, as an educated guess at what a Dell XPS 13 9380 needs, and said so in its header.
Its contents now come from nixos-generate-config --show-hardware-config on the running machine.

The guess turned out to be wider than the measurement rather than narrower.
It named thunderbolt, usb_storage, and sd_mod, none of which the scan reports, and omitted rtsx_pci_sdmmc for the card reader.
Nothing needed to reach the root device was missing, so the guess was adequate — it just was not accurate.
sd_mod survives in the resolved list regardless, supplied by nixpkgs' defaults; thunderbolt and usb_storage genuinely leave the initrd, and matter only for booting from external media.

Deviations

Two lines were dropped from the scan beyond the filesystem and swap declarations the task named.

  • boot.initrd.luks.devices."cryptroot".device — derived by hosts/neogaia/disk.nix, which already states that it owns this. Keeping it would create the same duplicate definition the task drops the filesystems to avoid.
  • hardware.cpu.intel.updateMicrocode — outside the three things the task keeps, and nixos-hardware supplies it.

Both were verified rather than assumed: after the change the LUKS device, all four filesystems, and microcode all still resolve, the last still true.

Review

Risk

Overall: HIGH

  • Blast radius: Medium — one file, but it feeds the initrd for the whole host
  • Reversibility: Medium — trivial revert, but a dia or a prior generation, not an edit
  • Test coverage: High — nix flake check provesrcises whether the initrd can unlock LUKS andmount root
  • Sensitive domain: Medium — gates LUKS unlock a
  • Size & complexity: Low — three strings removed
  • Runtime criticality: High — initrd is the most critical path on this machine

Unaddressed findings

  • Standards, declined. The reviewer read "Harate-config on this machine" as banned
    tool-narration. The ban covers narrating another placeholder example names that same generator,
    and the task asks the file to state what it hold

The reviewer's other standards finding — a headeattributes, which the comment convention forbidsas a feature inventory — is fixed in the diff. The spec axis returned no findings.

Not verified by a boot

nix flake check proves this evaluates and builoduces can unlock LUKS and mount root.
That needs a nixos-rebuild switch and a rebootn available at the bootloader as the fallback.

— Claude

Task: `.claude/tasks/0017-hardware-detection-refresh.md` `hosts/neogaia/hardware-configuration.nix` was written before this machine ran NixOS, as an educated guess at what a Dell XPS 13 9380 needs, and said so in its header. Its contents now come from `nixos-generate-config --show-hardware-config` on the running machine. The guess turned out to be wider than the measurement rather than narrower. It named `thunderbolt`, `usb_storage`, and `sd_mod`, none of which the scan reports, and omitted `rtsx_pci_sdmmc` for the card reader. Nothing needed to reach the root device was missing, so the guess was adequate — it just was not accurate. `sd_mod` survives in the resolved list regardless, supplied by nixpkgs' defaults; `thunderbolt` and `usb_storage` genuinely leave the initrd, and matter only for booting from external media. ## Deviations Two lines were dropped from the scan beyond the filesystem and swap declarations the task named. - `boot.initrd.luks.devices."cryptroot".device` — derived by `hosts/neogaia/disk.nix`, which already states that it owns this. Keeping it would create the same duplicate definition the task drops the filesystems to avoid. - `hardware.cpu.intel.updateMicrocode` — outside the three things the task keeps, and `nixos-hardware` supplies it. Both were verified rather than assumed: after the change the LUKS device, all four filesystems, and microcode all still resolve, the last still `true`. ## Review ### Risk **Overall: HIGH** - Blast radius: Medium — one file, but it feeds the initrd for the whole host - Reversibility: Medium — trivial revert, but a dia or a prior generation, not an edit - Test coverage: High — `nix flake check` provesrcises whether the initrd can unlock LUKS andmount root - Sensitive domain: Medium — gates LUKS unlock a - Size & complexity: Low — three strings removed - Runtime criticality: High — initrd is the most critical path on this machine ### Unaddressed findings - **Standards, declined.** The reviewer read "Harate-config on this machine" as banned tool-narration. The ban covers narrating another placeholder example names that same generator, and the task asks the file to state what it hold The reviewer's other standards finding — a headeattributes, which the comment convention forbidsas a feature inventory — is fixed in the diff. The spec axis returned no findings. ## Not verified by a boot `nix flake check` proves this evaluates and builoduces can unlock LUKS and mount root. That needs a `nixos-rebuild switch` and a rebootn available at the bootloader as the fallback. — Claude
alexion added 5 commits 2026-07-19 22:41:30 -04:00
The reimage is done and verified on hardware: the boot partition is 2 GiB
and reports it, the hardware profile's kernel parameter and module blacklist
are live, and the encrypted root unlocks to a console login.

The install procedure ran without divergence, which is the reproducibility
evidence the task was after.

The reimage also wiped the hand-written git identity, so the gotcha
describing it is updated to record the failure it now provokes.
Key sudo's credential cache per user rather than per terminal, holding it
for 60 minutes. An authentication made in the operator's own terminal then
covers commands issued by processes holding no terminal of their own, which
previously failed with a bare non-zero exit and no output.

No command is made passwordless. The password remains required; only the
cache holding it is shared, and any process running as the primary user can
spend that credential until it lapses.

A PreToolUse hook refuses a privileged command while the cache is cold,
naming the command that warms it, so the condition announces itself rather
than presenting as a stall. Both states were exercised against the running
system.
The detection file was written before the machine ran NixOS, as an educated
guess at what a Dell XPS 13 9380 needs, and said so. Its contents now come
from nixos-generate-config on the running machine.

The guess was wider than the measurement rather than narrower: it named
thunderbolt, usb_storage and sd_mod, none of which the scan reports, and
omitted rtsx_pci_sdmmc. Nothing needed to reach the root device was missing.

Filesystem, swap, LUKS and microcode declarations from the scan are dropped.
The disk layout derives the first three and the hardware profile supplies the
last, so carrying them here would duplicate definitions that are produced on
every evaluation.
alexion added 1 commit 2026-07-19 23:12:16 -04:00
alexion merged commit 7711b841dd into main 2026-07-19 23:12:42 -04:00
alexion deleted branch task-0017-hardware-detection-refresh 2026-07-19 23:12:42 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alexion/dotfiles#2