{ config, lib, pkgs, ... }: with pkgs; { # A bunch of boot parameters needed for optimal runtime on RPi 4B boot.kernelPackages = linuxPackages_rpi4; boot.kernelParams = [ "zfs.zfs_arc_max=134217728" "console=TTYAMA0,115200" "console=tty1" "8250.nr_uarts=1" "iomem=relaxed" "strict-devmem=0" ]; # Enable SATA-HAT GPIO features boot.loader = { grub.enable = false; generic-extlinux-compatible.enable = lib.mkForce false; raspberryPi = { enable = true; version = 4; firmwareConfig = '' iomem=relaxed strict-devmem=0 ''; }; }; # Load PWM hardware timers hardware.raspberry-pi."4".pwm0.enable = true; # Enable I2C hardware.raspberry-pi."4".i2c1.enable = true; }