2022-06-16 02:09:40 +00:00
|
|
|
# Configuration common to all Raspberry Pi 4 Model B devices
|
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
boot = {
|
|
|
|
initrd = {
|
|
|
|
availableKernelModules = [
|
|
|
|
"usbhid"
|
|
|
|
"usb_storage"
|
|
|
|
];
|
|
|
|
};
|
2022-07-25 07:18:14 +00:00
|
|
|
kernelPackages = pkgs.linuxPackages_5_15; # For a Raspberry Pi 4
|
2022-06-16 02:09:40 +00:00
|
|
|
kernelParams = [
|
|
|
|
"cma=128M" # Many GUI programs need this, nearly all wayland applications
|
|
|
|
"8250.nr_uarts=1"
|
|
|
|
"console=ttyAMA0,115200" # the serial console broken out to the GPIO
|
|
|
|
"console=tty1"
|
|
|
|
];
|
|
|
|
loader = {
|
|
|
|
grub = {
|
|
|
|
enable = false; # NixOS wants to enable GRUB by default.
|
|
|
|
};
|
|
|
|
};
|
2024-12-05 12:34:22 +00:00
|
|
|
tmp.useTmpfs = true;
|
2022-06-16 02:09:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# File systems configuration for using the installer's partition layout
|
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
|
|
|
device = "/dev/disk/by-label/NIXOS_SD";
|
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
"/boot/firmware" = {
|
|
|
|
device = "/dev/disk/by-label/FIRMWARE";
|
|
|
|
fsType = "vfat";
|
|
|
|
# Alternatively, this could be removed from the configuration.
|
|
|
|
# The filesystem is not needed at runtime, it could be treated
|
|
|
|
# as an opaque blob instead of a discrete FAT32 filesystem.
|
|
|
|
options = ["nofail" "noauto"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# !!! Adding a swap file is optional, but strongly recommended!
|
|
|
|
swapDevices = [
|
|
|
|
{
|
|
|
|
device = "/swapfile";
|
|
|
|
size = 1024;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
hardware = {
|
|
|
|
enableRedistributableFirmware = true; # Enable support for Pi firmware blobs
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
libraspberrypi # Userland tools for the Raspberry Pi board
|
|
|
|
];
|
|
|
|
}
|