nixos-config/machines/fort.nix
2024-08-24 14:12:16 +02:00

98 lines
2.5 KiB
Nix

{ my, pkgs, ... }:
let
hetznerWanIfName = "enp1s0";
hetznerWanNetwork = {
matchConfig.Name = hetznerWanIfName;
routes = [
{
Gateway = "172.31.1.1";
GatewayOnLink = true;
}
{ Gateway = "fe80::1"; }
];
dns = [ "185.12.64.1" "185.12.64.2" ];
linkConfig.RequiredForOnline = "routable";
};
in {
imports = [
../secrets/machines/fort.nix
../services/alertmanager.nix
../services/conduit.nix
../services/fail2ban.nix
../services/forgejo.nix
../services/matrix-hookshot.nix
../services/nginx.nix
../services/node-exporter.nix
../services/restic-client.nix
../services/vaultwarden.nix
../services/vikunja.nix
../services/web/c8h4-io.nix
../services/yarr.nix
../system/btrfs.nix
../system/deploy-target.nix
../system/virtual-machine.nix
];
system.stateVersion = "23.05";
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "sd_mod" "sr_mod" ];
boot.loader.grub.device = "/dev/sda";
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
fileSystems."/" = {
device = "/dev/disk/by-uuid/0ec38da7-36b2-437c-b4dd-45d5ed620979";
fsType = "btrfs";
options = [ "noatime" "subvol=@" "discard=async" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/0ec38da7-36b2-437c-b4dd-45d5ed620979";
fsType = "btrfs";
options = [ "noatime" "subvol=@boot" "discard=async" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/0ec38da7-36b2-437c-b4dd-45d5ed620979";
fsType = "btrfs";
options = [ "subvol=@home" "discard=async" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/0ec38da7-36b2-437c-b4dd-45d5ed620979";
fsType = "btrfs";
options = [ "noatime" "compress=zstd" "subvol=@nix" "discard=async" ];
};
fileSystems."/var/log" = {
device = "/dev/disk/by-uuid/0ec38da7-36b2-437c-b4dd-45d5ed620979";
fsType = "btrfs";
options = [ "noatime" "compress=zstd" "subvol=@log" "discard=async" ];
};
fileSystems."/mnt/data" = {
device = "/dev/disk/by-uuid/6dac6942-330c-429c-8992-8b11f5c137bb";
fsType = "btrfs";
options = [ "noatime" "discard=async" ];
};
services.btrfs.autoScrub.fileSystems = [ "/" "/mnt/data" ];
services.nginx.appendConfig = ''
worker_processes auto;
'';
environment.systemPackages = with pkgs; [ wireguard-tools ];
networking.hosts = my.homelab.hosts;
networking.useDHCP = false;
systemd.network = {
enable = true;
networks."10-wan" = hetznerWanNetwork // {
address = [ "128.140.95.112/32" "2a01:4f8:c17:6f57::1/64" ];
};
};
}