2023-08-20 04:25:58 -06:00
|
|
|
{ config, pkgs, inputs, makeEnable, ... }:
|
2021-07-10 13:39:40 -06:00
|
|
|
|
2024-09-26 14:15:27 -06:00
|
|
|
makeEnable config "myModules.raspberry-pi" false {
|
2023-08-01 19:20:33 -06:00
|
|
|
imports = [
|
|
|
|
inputs.nixos-hardware.nixosModules.raspberry-pi-4
|
|
|
|
];
|
2023-08-08 13:21:52 -06:00
|
|
|
# These are needed to allow hardware acceleration again
|
2023-06-29 13:37:17 -06:00
|
|
|
# https://github.com/NixOS/nixos-hardware/issues/631
|
2023-08-08 13:21:52 -06:00
|
|
|
boot.kernelParams = [ "kunit.enable=0" ];
|
|
|
|
hardware.deviceTree.filter = "bcm2711-rpi-4*.dtb";
|
|
|
|
hardware.raspberry-pi."4".fkms-3d.enable = true;
|
2023-06-29 13:37:17 -06:00
|
|
|
# hardware.raspberry-pi."4".audio.enable = true;
|
|
|
|
|
|
|
|
boot = {
|
2024-09-30 20:40:39 -06:00
|
|
|
initrd.systemd.tpm2.enable = false;
|
2023-06-29 13:37:17 -06:00
|
|
|
initrd.availableKernelModules = [
|
|
|
|
"usbhid"
|
|
|
|
"usb_storage"
|
|
|
|
"vc4"
|
|
|
|
"pcie_brcmstb" # required for the pcie bus to work
|
|
|
|
"reset-raspberrypi" # required for vl805 firmware to load
|
|
|
|
];
|
|
|
|
|
|
|
|
loader = {
|
|
|
|
grub.enable = false;
|
|
|
|
generic-extlinux-compatible.enable = true;
|
|
|
|
};
|
|
|
|
};
|
2023-08-01 17:47:16 -06:00
|
|
|
|
2023-06-29 13:37:17 -06:00
|
|
|
boot.extraModulePackages = [ ];
|
2021-07-10 13:39:40 -06:00
|
|
|
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
|
2023-07-27 19:49:44 -06:00
|
|
|
# networking.useDHCP = true;
|
2021-07-10 13:39:40 -06:00
|
|
|
networking.interfaces.eth0.useDHCP = true;
|
|
|
|
networking.interfaces.wlan0.useDHCP = true;
|
|
|
|
|
|
|
|
powerManagement.cpuFreqGovernor = "ondemand";
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
raspberrypi-eeprom
|
|
|
|
];
|
|
|
|
|
2021-08-21 13:06:26 -06:00
|
|
|
environment = {
|
|
|
|
# This allows alacritty to run
|
|
|
|
extraInit = ''
|
|
|
|
export LIBGL_ALWAYS_SOFTWARE=1
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-07-10 13:39:40 -06:00
|
|
|
nix = {
|
2023-07-28 17:18:56 -06:00
|
|
|
# auto-optimise-store = true;
|
2021-07-10 13:39:40 -06:00
|
|
|
gc = {
|
|
|
|
automatic = true;
|
|
|
|
dates = "weekly";
|
|
|
|
options = "--delete-older-than 30d";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|