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

69 lines
2.4 KiB
Nix
Raw Normal View History

2023-09-16 13:58:47 +02:00
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
2023-12-13 06:17:46 +01:00
{ inputs, config, lib, pkgs, modulesPath, ... }: {
2023-09-16 13:58:47 +02:00
imports = [
2023-12-13 06:17:46 +01:00
inputs.nixos-hardware.nixosModules.raspberry-pi-4
2023-09-16 13:58:47 +02:00
(modulesPath + "/installer/scan/not-detected.nix")
];
# Enable distributed Builds
nix.distributedBuilds = true;
2023-12-13 06:17:46 +01:00
hardware = {
raspberry-pi."4".apply-overlays-dtmerge.enable = true;
deviceTree = {
enable = true;
filter = "*rpi-4-*.dtb";
};
};
console.enable = false;
environment.systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
];
2023-09-16 13:58:47 +02:00
#####################################################################################
# BEGIN hardware config
#####################################################################################
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
boot.loader.grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf
boot.loader.generic-extlinux-compatible.enable = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
2023-09-18 13:55:01 +02:00
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
};
2023-09-16 13:58:47 +02:00
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
networking.hostName = "nixos-rpi4-02";
#####################################################################################
# END hardware config
#####################################################################################
# Generic Tailscale configs are in /nixos/common/services/tailscale.nix
# Set up the secrets file:
2023-09-18 13:54:09 +02:00
sops.secrets."tailscale_keys/nixos-rpi4-02" = {
2023-09-16 13:58:47 +02:00
owner = "root";
sopsFile = ../../../secrets/tailscale.yaml;
restartUnits = [
"tailscaled.service"
"tailscaled-autoconnect.service"
];
};
2023-09-18 13:49:11 +02:00
services.tailscale.authKeyFile = "/run/secrets/tailscale_keys/nixos-rpi4-02";
2023-09-16 13:58:47 +02:00
services.tailscale.extraUpFlags = [ "--advertise-exit-node" ];
boot.kernel.sysctl = { "net.ipv4.ip_forward" = true; };
# Temporary
2023-09-19 10:39:24 +02:00
# networking.firewall.allowedTCPPorts = [ 22 ];
2023-09-16 13:58:47 +02:00
}