10.nixos-hardware/raspberry-pi/5/default.nix
Cryolitia PukNgae c8f766fd11 raspberry-pi: move kernel and firmware from nixpkgs
As part of the gradual phasing out of linux_rpi in nixpkgs

Link: https://github.com/NixOS/nixpkgs/pull/477665

Signed-off-by: Cryolitia PukNgae <Cryolitia@gmail.com>
2026-01-18 23:19:14 +08:00

40 lines
993 B
Nix

{
lib,
pkgs,
config,
...
}:
{
boot = {
kernelPackages = lib.mkDefault (
pkgs.linuxPackagesFor (
pkgs.callPackage ../common/kernel.nix {
rpiVersion = 5;
}
)
);
initrd.availableKernelModules = [
"nvme"
"usbhid"
"usb-storage"
];
};
# Needed for Xorg to start (https://github.com/raspberrypi-ui/gldriver-test/blob/master/usr/lib/systemd/scripts/rp1_test.sh)
# This won't work for displays connected to the RP1 (DPI/composite/MIPI DSI), since I don't have one to test.
services.xserver.extraConfig = ''
Section "OutputClass"
Identifier "vc4"
MatchDriver "vc4"
Driver "modesetting"
Option "PrimaryGPU" "true"
EndSection
'';
assertions = [
{
assertion = (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.1.54");
message = "The Raspberry Pi 5 requires a newer kernel version (>=6.1.54). Please upgrade nixpkgs for this system.";
}
];
}