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

55 lines
2.1 KiB
Nix
Raw Normal View History

2023-09-14 14:45:40 +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-09-15 06:21:03 +02:00
{ config, lib, pkgs, modulesPath, ... }: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
2023-09-15 14:29:33 +02:00
2023-09-15 06:21:03 +02:00
];
# Enable distributed Builds
nix.distributedBuilds = true;
2023-09-15 16:45:41 +02:00
#####################################################################################
# BEGIN hardware config
#####################################################################################
2023-09-14 14:45:40 +02:00
2023-09-14 14:57:18 +02:00
# 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;
2023-09-14 14:45:40 +02:00
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
2023-09-15 16:45:41 +02:00
fileSystems."/" = {
2023-09-18 13:55:01 +02:00
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
};
2023-09-14 14:45:40 +02:00
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
2023-09-15 10:01:30 +02:00
networking.hostName = "nixos-rpi4-01";
2023-09-15 16:45:41 +02:00
#####################################################################################
# END hardware config
#####################################################################################
2023-09-16 01:41:09 +02:00
# 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-01" = {
2023-09-15 16:45:41 +02:00
owner = "root";
2023-09-15 16:46:50 +02:00
sopsFile = ../../../secrets/tailscale.yaml;
2023-09-16 05:08:02 +02:00
restartUnits = [
"tailscaled.service"
"tailscaled-autoconnect.service"
];
2023-09-15 16:45:41 +02:00
};
2023-09-18 13:49:11 +02:00
services.tailscale.authKeyFile = "/run/secrets/tailscale_keys/nixos-rpi4-01";
2023-09-15 16:45:41 +02:00
services.tailscale.extraUpFlags = [ "--advertise-exit-node" ];
2023-09-15 16:55:21 +02:00
boot.kernel.sysctl = { "net.ipv4.ip_forward" = true; };
2023-09-15 10:14:19 +02:00
# Temporary
2023-09-19 13:37:21 +02:00
# networking.firewall.allowedTCPPorts = [ 22 ];
2023-09-14 14:45:40 +02:00
}