refactor(deploy): key the Pi build machinery by board
piBaseModules hardcoded the nixos-hardware raspberry-pi-5 module and our raspberry-pi-5.nix glue, so mkPiInstalled/mkPiImage could only ever produce a Pi 5. Everything else in the Pi runtime is board-agnostic. Introduce `piBoards`, keyed by machine model — the parameter already threaded through both builders — pairing each board's nixos-hardware module with its glue file, and have piBaseModules look the pair up. Same modules in the same order for rpi5, so its evaluated configuration is unchanged (compared on 16 app-independent facets: kernel, params, initrd modules, loader, device tree, video drivers, udev, filesystems, swap, nix settings, sleep targets, service exec/memory, env seed, sshd). No new board yet — that's the next commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013A6683cCHnQxFUosx1krY4
This commit is contained in:
parent
77c91357b2
commit
7abcc3165a
1 changed files with 15 additions and 3 deletions
18
flake.nix
18
flake.nix
|
|
@ -308,14 +308,26 @@
|
|||
fiatCode = fiatCodeForModel.${machineModel} or "USD";
|
||||
};
|
||||
|
||||
# Supported Pi boards, keyed by machine model. Each pairs the
|
||||
# nixos-hardware board module (kernel, firmware, bootloader, device tree)
|
||||
# with our own hardware glue (validator serial, kiosk display, no-suspend).
|
||||
# Everything else in the Pi runtime is board-agnostic.
|
||||
piBoards = {
|
||||
rpi5 = {
|
||||
hardware = nixos-hardware.nixosModules.raspberry-pi-5;
|
||||
glue = ./deploy/nixos/hardware/raspberry-pi-5.nix;
|
||||
};
|
||||
};
|
||||
|
||||
# Shared module list (everything EXCEPT the root fs and the sd-image
|
||||
# builder). atm-app/fiatCode are threaded in so both products share one
|
||||
# evaluated app closure.
|
||||
piBaseModules = { machineModel, atm-app, fiatCode }: [
|
||||
nixos-hardware.nixosModules.raspberry-pi-5
|
||||
piBaseModules = { machineModel, atm-app, fiatCode }:
|
||||
let board = piBoards.${machineModel}; in [
|
||||
board.hardware
|
||||
./deploy/nixos/configuration.nix
|
||||
./deploy/nixos/bitspire-atm.nix
|
||||
./deploy/nixos/hardware/raspberry-pi-5.nix
|
||||
board.glue
|
||||
({ config, lib, pkgs, pkgs-unstable, ... }: {
|
||||
services.bitspire = {
|
||||
enable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue