10.nixos-hardware/raspberry-pi/4/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

68 lines
1.5 KiB
Nix

{
lib,
pkgs,
config,
...
}:
{
imports = [
./audio.nix
./backlight.nix
./bluetooth.nix
./cpu-revision.nix
./digi-amp-plus.nix
./dwc2.nix
./gpio.nix
./i2c.nix
./leds.nix
./modesetting.nix
./pkgs-overlays.nix
./poe-hat.nix
./poe-plus-hat.nix
./pwm0.nix
./tc358743.nix
./touch-ft5406.nix
./tv-hat.nix
./xhci.nix
];
boot = {
kernelPackages = lib.mkDefault (
pkgs.linuxPackagesFor (
pkgs.callPackage ../common/kernel.nix {
rpiVersion = 4;
}
)
);
initrd.availableKernelModules = [
"usbhid"
"usb-storage"
"vc4"
"pcie-brcmstb" # required for the pcie bus to work
"reset-raspberrypi" # required for vl805 firmware to load
]
++ lib.optional config.boot.initrd.network.enable "genet";
# Allow building kernel
initrd.systemd.tpm2.enable = false;
loader = {
grub.enable = lib.mkDefault false;
generic-extlinux-compatible.enable = lib.mkDefault true;
};
};
hardware.deviceTree.filter = lib.mkDefault "bcm2711-rpi-*.dtb";
assertions = [
{
assertion = (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.1");
message = "This version of raspberry pi 4 dts overlays requires a newer kernel version (>=6.1). Please upgrade nixpkgs for this system.";
}
];
hardware.firmware = [
(pkgs.callPackage ../common/raspberry-pi-wireless-firmware.nix { })
];
}