Files
cyper-rpi/nixos/hardware.nix
2026-02-11 20:52:39 +01:00

49 lines
871 B
Nix

{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
];
# Bootloader
boot = {
#kernelPackages = pkgs.linuxPackages_rpi4;
kernelPackages = pkgs.linuxPackages_latest;
initrd.availableKernelModules = [
"xhci_pci"
"usbhid"
"usb_storage"
];
loader.generic-extlinux-compatible.enable = true;
kernelParams = [ "console=ttyS0,115200n8" ];
supportedFilesystems = lib.mkForce [ "ext4" ];
};
# File systems
fileSystems."/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
# Swap
swapDevices = [
{
device = "/swapfile";
size = 4096;
}
];
# RPi 4 specific hardware
hardware.enableRedistributableFirmware = true;
# SD Image
image.baseName = "nixos-rpi4";
}