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

61 lines
1.9 KiB
Nix
Raw Normal View History

2024-03-14 01:53:52 +01:00
{ lib, pkgs, modulesPath, ... }: {
2023-12-13 06:17:46 +01:00
imports = [
2024-01-30 09:50:33 +01:00
# inputs.nixos-hardware.nixosModules.raspberry-pi-4
2023-12-13 06:17:46 +01:00
(modulesPath + "/installer/scan/not-detected.nix")
../../common/services/tailscale-autoconnect.nix
2024-03-14 01:53:52 +01:00
../../common/services/podman.nix
2024-03-25 01:46:12 +01:00
./containers/piaware.nix
2023-12-13 06:17:46 +01:00
];
# Enable distributed Builds
nix.distributedBuilds = true;
2023-12-15 08:48:55 +01:00
console.enable = true;
2023-12-13 06:17:46 +01:00
environment.systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
];
2023-12-15 13:38:01 +01:00
# Set your time zone.
time.timeZone = "Asia/Tokyo";
2023-12-13 06:17:46 +01:00
#####################################################################################
# BEGIN hardware config
#####################################################################################
2024-01-30 09:43:44 +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-13 06:17:46 +01:00
2024-01-30 09:43:44 +01:00
initrd.kernelModules = [ ];
kernelModules = [ ];
extraModulePackages = [ ];
};
2023-12-13 06:17:46 +01:00
fileSystems."/" = {
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
};
2024-01-30 09:19:56 +01:00
2024-01-30 09:35:28 +01:00
hardware.enableRedistributableFirmware = true;
2023-12-13 06:17:46 +01:00
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
networking.hostName = "piaware-rpi4";
#####################################################################################
# END hardware config
#####################################################################################
services.tailscale.extraUpFlags = [ "--advertise-exit-node" ];
boot.kernel.sysctl = { "net.ipv4.ip_forward" = true; };
2024-03-14 01:53:52 +01:00
}