2024-05-01 15:40:27 -04:00
|
|
|
{ lib, pkgs, config, ... }:
|
2024-05-05 00:59:23 -04:00
|
|
|
let
|
|
|
|
linux_rpi5 = pkgs.linux_rpi4.override {
|
|
|
|
rpiVersion = 5;
|
|
|
|
argsOverride.defconfig = "bcm2712_defconfig";
|
|
|
|
};
|
|
|
|
in
|
2024-04-25 21:57:25 -04:00
|
|
|
{
|
|
|
|
boot = {
|
2024-05-05 00:59:23 -04:00
|
|
|
kernelPackages = lib.mkDefault (pkgs.linuxPackagesFor linux_rpi5);
|
2024-04-25 21:57:25 -04:00
|
|
|
initrd.availableKernelModules = [
|
2024-04-30 17:46:48 -04:00
|
|
|
"nvme"
|
2024-04-25 21:57:25 -04:00
|
|
|
"usbhid"
|
|
|
|
"usb_storage"
|
|
|
|
];
|
|
|
|
};
|
2024-04-30 13:24:45 -04:00
|
|
|
|
|
|
|
# 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
|
|
|
|
'';
|
2024-05-01 15:40:27 -04:00
|
|
|
|
|
|
|
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.";
|
|
|
|
}
|
|
|
|
];
|
2024-04-25 21:57:25 -04:00
|
|
|
}
|