NixOS on ARM/Raspberry Pi 5
|Raspberry Pi 5 Family
|Raspberry Pi Foundation
|Custom or UEFI
|Configurable; SD, USB, Netboot
|Raspberry Pi 5B
The Raspberry Pi family of devices is a series of single-board computers made by the Raspberry Pi Foundation. They are all based on Broadcom System-on-a-chip (SoCs).
Support for the Raspberry Pi 5 is currently downstream and experimental. It will not be fully supported until mature support exists in upstream Linux and U-Boot, but using UEFI already provides a workable solution.
For the GPU drivers to work,
dtoverlay=vc4-kms-v3d-pi5 must be added to
/boot/config.txt, and the vendor kernel must currently be used. Only Wayland-based compositors are supported. Note that Xwayland applications may produce broken graphics on KDE; the root cause of this issue has not yet been evaluated.
Board-specific installation notes
EDK2 enables booting a mainline kernel, but hardware support will be very limited. Notably, you'll need to perform the installation using Wi-Fi, as Ethernet is unsupported. Once the system is installed, you can switch to the vendor's modified kernel. This is not (yet?) available in Nixpkgs, so you'll need to get it from a flake. If you're not using flakes, you can simply add this to your configuration:
boot.kernelPackages = (import (builtins.fetchTarball https://gitlab.com/vriska/nix-rpi5/-/archive/main.tar.gz)).legacyPackages.aarch64-linux.linuxPackages_rpi5;
For the vendor kernel to boot properly, you must switch from ACPI to Device Tree in the UEFI settings (at Device Manager -> Raspberry Pi Configuration -> ACPI / Device Tree -> System Table Mode). When using the vendor kernel (which provides full power management support), you may additionally wish to remove
If you are using nixos-unstable, then you can also use the rpi4 kernel (this is supposed to be a generic aarch64 kernel for rpi 3,4,5). Although, due to a smaller page size, this will have slightly worse performance:
boot.kernelPackages = pkgs.linuxPackages_rpi4;