2022-06-17 17:06:21 +02:00
|
|
|
{ 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
|
2022-07-12 21:02:11 +02:00
|
|
|
boot.loader = {
|
|
|
|
grub.enable = false;
|
|
|
|
generic-extlinux-compatible.enable = lib.mkForce false;
|
|
|
|
};
|
2022-06-17 17:06:21 +02:00
|
|
|
boot.loader.raspberryPi = {
|
|
|
|
enable = true;
|
|
|
|
version = 4;
|
|
|
|
firmwareConfig = ''
|
|
|
|
iomem=relaxed
|
|
|
|
strict-devmem=0
|
|
|
|
dtoverlay=w1-gpio
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
boot.kernelModules = [ "pwm_bcm2835" "w1-gpio" "w1-therm" ];
|
2022-07-12 21:02:11 +02:00
|
|
|
# Load PWM hardware timers
|
|
|
|
hardware.raspberry-pi."4".pwm0.enable = true;
|
2022-06-17 17:06:21 +02:00
|
|
|
|
|
|
|
# Enable I2C
|
2022-07-12 21:02:11 +02:00
|
|
|
hardware.raspberry-pi."4".i2c1.enable = true;
|
2022-06-17 17:06:21 +02:00
|
|
|
|
|
|
|
}
|