nix/nixos/hosts/quitman-rpi4/default.nix

63 lines
2 KiB
Nix
Raw Normal View History

2024-04-24 03:40:47 +02:00
{ inputs, lib, pkgs, modulesPath, ... }: {
2023-12-19 03:39:37 +01:00
imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-4
(modulesPath + "/installer/scan/not-detected.nix")
../../common/services/tailscale-autoconnect.nix
2023-12-19 03:39:37 +01:00
];
# Enable distributed Builds
nix.distributedBuilds = true;
console.enable = true;
environment.systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
];
# Set your time zone.
2024-12-11 22:57:30 +01:00
time.timeZone = "America/Chicago";
2023-12-19 03:39:37 +01:00
#####################################################################################
# BEGIN hardware config
#####################################################################################
2024-12-11 23:38:06 +01:00
boot = {
initrd.availableKernelModules = [
"xhci_pci"
"usbhid"
"usb_storage"
"vc4"
"pcie_brcmstb" # required for the pcie bus to work
"reset-raspberrypi" # required for vl805 firmware to load
];
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
loader.grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf
loader.generic-extlinux-compatible.enable = true;
2023-12-19 03:39:37 +01:00
2024-12-11 23:38:06 +01:00
initrd.kernelModules = [ ];
kernelModules = [ ];
extraModulePackages = [ ];
};
2023-12-19 03:39:37 +01:00
fileSystems."/" = {
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
};
2024-12-11 23:38:06 +01:00
hardware.enableRedistributableFirmware = true;
2023-12-19 03:39:37 +01:00
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
networking.hostName = "quitman-rpi4";
#####################################################################################
# END hardware config
#####################################################################################
services.tailscale.extraUpFlags = [
"--advertise-exit-node"
"--advertise-routes=192.168.68.0/22"
];
2023-12-19 03:39:37 +01:00
boot.kernel.sysctl = { "net.ipv4.ip_forward" = true; };
2024-12-11 00:13:50 +01:00
networking.firewall.allowedTCPPorts = [ 22 ];
2024-04-24 03:40:47 +02:00
}