dotfiles/nixos/raspberry-pi.nix

60 lines
1.4 KiB
Nix
Raw Normal View History

{ config, pkgs, inputs, makeEnable, ... }:
2024-09-26 14:15:27 -06:00
makeEnable config "myModules.raspberry-pi" false {
imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-4
];
# These are needed to allow hardware acceleration again
# https://github.com/NixOS/nixos-hardware/issues/631
boot.kernelParams = [ "kunit.enable=0" ];
hardware.deviceTree.filter = "bcm2711-rpi-4*.dtb";
hardware.raspberry-pi."4".fkms-3d.enable = true;
# hardware.raspberry-pi."4".audio.enable = true;
boot = {
2024-09-30 20:40:39 -06:00
initrd.systemd.tpm2.enable = false;
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
boot.extraModulePackages = [ ];
hardware.enableRedistributableFirmware = true;
# networking.useDHCP = true;
networking.interfaces.eth0.useDHCP = true;
networking.interfaces.wlan0.useDHCP = true;
powerManagement.cpuFreqGovernor = "ondemand";
environment.systemPackages = with pkgs; [
raspberrypi-eeprom
];
environment = {
# This allows alacritty to run
extraInit = ''
export LIBGL_ALWAYS_SOFTWARE=1
'';
};
nix = {
2023-07-28 17:18:56 -06:00
# auto-optimise-store = true;
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
}