feat: Raspberry Pi 4 (aarch64) target #110

Open
padreug wants to merge 12 commits from feat/rpi4-target into feat/rpi5-apex-hal
Showing only changes of commit 029bb09745 - Show all commits

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
Padreug 2026-09-20 11:26:02 +02:00

View file

@ -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;