feat: pi-sdcard template (Raspberry Pi NixOS SD-card image, native or cross-built) #6
Loading…
Reference in a new issue
No description provided.
Delete branch "t3code/211fb33b"
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?
A Raspberry Pi 3/4/5 (aarch64) NixOS starter that builds a flashable SD-card image, in the spirit of basalt-rs/nix-pi-base but as a starters template: MBR layout, FAT32 firmware partition (Pi firmware + U-Boot, extlinux boot), auto-expanding ext4 root, headless key-only-ssh defaults (wheel user
pi,initialPasswordfor the HDMI console only).Build routes (
nix build .#sd-imagepicks per host)nixosConfigurations.pi— closure substitutes from cache.nixos.orgnixosConfigurations.pi-cross— cross-compiled (nixpkgs.buildPlatform = x86_64-linux), runs anywherePlus a safety-checked flasher:
nix run .#flash -- /dev/sdX(refuses non-/dev targets, non-block devices, and mounted devices; decompresses the.img.zston the fly).Verification (all local, per the too-heavy-for-CI rule)
.img.zst(3.85 GiB image), 509 derivations built locally, rest substitutede2fsck -fn, extlinux entries point at the cross-built 6.18.56 kernel, ~2050 store paths + nix-path-registration presentnix flake init -t path:...#pi-sdcardon a fresh copy →nix flake check+nix run .#validategreen (evaluation-only gates)nix fmt+nix flake checkgreenCI
The image is a multi-hour build, so it is deliberately not built in CI: the template's own workflow runs the two canonical gates (eval-only), and the root workflow gets a
heavyskip list so it does not instantiate this template per-push. The README standards section now codifies that heavy templates are eval-gated and must be built locally before merging.Note: x86_64-darwin is not in the template's
systems— nixpkgs unstable dropped it in 26.11 (documented in the template README + parts.nix).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.