Hardware device paths have two sources of truth — the NixOS module's defaults are wrong for every model, and warn misleadingly at boot #117
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every douro boot logs:
The validator is fine. It's a JCM iVIZION on
/dev/ttyS0, and the app drives it correctly — same boot, a few seconds later:The warning comes from
deploy/nixos/bitspire-atm.nixpreStart checkingcfg.billValidator.device, which is the module default/dev/ttyUSB0. The app doesn't use that value — it readsapps/machine/src/config/device.ts, keyed onVITE_LAMASSU_MACHINE_MODEL, where douro isvalidator /dev/ttyS0(id003) anddispenser /dev/ttyS1(puloon).So the same fact is declared in two places and they disagree. The nix side is not just stale, it's unset:
billValidator,billDispenserandcameraare never assigned for any model — not in flake.nix, not in anyhardware/*.nix, not in live.nix — so every machine runs on defaults of/dev/ttyUSB0,/dev/ttyUSB1, andbillDispenser.enable = false(the douro plainly has a dispenser).Those options feed exactly two consumers, neither authoritative:
/etc/bitspire/config.env, which the module's own comment says is descriptive and NOT the runtime environment, since the flake mkForcesEnvironmentFileto/var/lib/bitspire/.env. So it advertisesBILL_VALIDATOR_DEVICE=/dev/ttyUSB0to anyone who reads it looking for the truth.Cost is real if small: it burned time while debugging the douro this week. The box looked like it had a missing validator on every boot, which is a plausible-sounding symptom for a machine that wasn't working, and it isn't true.
Cleanest fix is to delete the duplicate rather than sync it — drop
billValidator/billDispenser/camera(or at least the device/type fields), the preStart check, and the hardware block inconfig.env, leavingdevice.tsas the single source of truth. The alternative — keeping the nix options and making them authoritative by passing them to the app — is a bigger change that inverts ownership, and nothing needs it today.If the preStart check is worth keeping as an early warning, it should read the same table the app does rather than a parallel default.
Checked the open tracker first; no existing issue covers this.