2023-07-28 23:13:28 +02:00
|
|
|
{ my, pkgs, ... }:
|
|
|
|
|
2023-07-29 19:36:51 +02:00
|
|
|
let
|
|
|
|
hetznerWanIfName = "enp1s0";
|
|
|
|
hetznerWanNetwork = {
|
|
|
|
matchConfig.Name = hetznerWanIfName;
|
2023-10-21 10:28:43 +02:00
|
|
|
routes = [
|
|
|
|
{
|
2024-06-03 11:14:05 +02:00
|
|
|
Gateway = "172.31.1.1";
|
|
|
|
GatewayOnLink = true;
|
2023-10-21 10:28:43 +02:00
|
|
|
}
|
2024-06-03 11:14:05 +02:00
|
|
|
{ Gateway = "fe80::1"; }
|
2023-10-21 10:28:43 +02:00
|
|
|
];
|
2023-07-29 19:36:51 +02:00
|
|
|
dns = [ "185.12.64.1" "185.12.64.2" ];
|
|
|
|
linkConfig.RequiredForOnline = "routable";
|
|
|
|
};
|
|
|
|
in {
|
2023-07-28 23:13:28 +02:00
|
|
|
imports = [
|
2024-01-07 02:58:44 +01:00
|
|
|
../secrets/machines/fort.nix
|
2024-04-20 21:27:19 +02:00
|
|
|
../services/alertmanager.nix
|
2023-11-13 13:13:41 +01:00
|
|
|
../services/conduit.nix
|
2023-10-11 22:07:22 +02:00
|
|
|
../services/fail2ban.nix
|
2024-06-24 23:07:44 +02:00
|
|
|
../services/git-ingress.nix
|
2023-12-04 20:38:33 +01:00
|
|
|
../services/matrix-hookshot.nix
|
2023-07-28 23:13:28 +02:00
|
|
|
../services/nginx.nix
|
2024-03-03 21:31:45 +01:00
|
|
|
../services/node-exporter.nix
|
2024-05-07 01:00:09 +02:00
|
|
|
../services/restic-client.nix
|
2023-07-31 20:08:23 +02:00
|
|
|
../services/web/c8h4-io.nix
|
2024-05-12 15:01:59 +02:00
|
|
|
../system/btrfs.nix
|
2024-05-28 13:35:04 +02:00
|
|
|
../system/deploy-target.nix
|
2023-07-28 23:13:28 +02:00
|
|
|
../system/virtual-machine.nix
|
|
|
|
];
|
|
|
|
|
2024-01-06 18:41:52 +01:00
|
|
|
system.stateVersion = "23.05";
|
2023-07-29 18:40:46 +02:00
|
|
|
|
2024-01-06 18:41:52 +01:00
|
|
|
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "sd_mod" "sr_mod" ];
|
|
|
|
boot.loader.grub.device = "/dev/sda";
|
2023-07-29 18:40:46 +02:00
|
|
|
|
2023-10-13 18:17:24 +02:00
|
|
|
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
|
|
|
|
|
2023-07-28 23:13:28 +02:00
|
|
|
fileSystems."/" = {
|
2023-07-29 18:40:46 +02:00
|
|
|
device = "/dev/disk/by-uuid/0ec38da7-36b2-437c-b4dd-45d5ed620979";
|
2023-07-28 23:13:28 +02:00
|
|
|
fsType = "btrfs";
|
2024-08-17 00:55:17 +02:00
|
|
|
options = [ "noatime" "subvol=@" "discard=async" ];
|
2023-07-28 23:13:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/boot" = {
|
2023-07-29 18:40:46 +02:00
|
|
|
device = "/dev/disk/by-uuid/0ec38da7-36b2-437c-b4dd-45d5ed620979";
|
|
|
|
fsType = "btrfs";
|
2024-08-17 00:55:17 +02:00
|
|
|
options = [ "noatime" "subvol=@boot" "discard=async" ];
|
2023-07-28 23:13:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/home" = {
|
2023-07-29 18:40:46 +02:00
|
|
|
device = "/dev/disk/by-uuid/0ec38da7-36b2-437c-b4dd-45d5ed620979";
|
2023-07-28 23:13:28 +02:00
|
|
|
fsType = "btrfs";
|
2024-08-17 00:55:17 +02:00
|
|
|
options = [ "subvol=@home" "discard=async" ];
|
2023-07-28 23:13:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/nix" = {
|
2023-07-29 18:40:46 +02:00
|
|
|
device = "/dev/disk/by-uuid/0ec38da7-36b2-437c-b4dd-45d5ed620979";
|
2023-07-28 23:13:28 +02:00
|
|
|
fsType = "btrfs";
|
2024-08-17 00:55:17 +02:00
|
|
|
options = [ "noatime" "compress=zstd" "subvol=@nix" "discard=async" ];
|
2023-07-28 23:13:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/var/log" = {
|
2023-07-29 18:40:46 +02:00
|
|
|
device = "/dev/disk/by-uuid/0ec38da7-36b2-437c-b4dd-45d5ed620979";
|
2023-07-28 23:13:28 +02:00
|
|
|
fsType = "btrfs";
|
2024-08-17 00:55:17 +02:00
|
|
|
options = [ "noatime" "compress=zstd" "subvol=@log" "discard=async" ];
|
2023-07-28 23:13:28 +02:00
|
|
|
};
|
|
|
|
|
2024-08-17 00:58:01 +02:00
|
|
|
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" ];
|
2024-05-12 15:01:59 +02:00
|
|
|
|
2024-06-04 17:23:57 +02:00
|
|
|
services.nginx.appendConfig = ''
|
|
|
|
worker_processes auto;
|
|
|
|
'';
|
|
|
|
|
2023-07-28 23:13:28 +02:00
|
|
|
environment.systemPackages = with pkgs; [ wireguard-tools ];
|
|
|
|
|
2023-12-14 18:43:39 +01:00
|
|
|
networking.hosts = my.homelab.hosts;
|
2023-11-04 00:23:53 +01:00
|
|
|
networking.useDHCP = false;
|
|
|
|
|
2023-07-28 23:13:28 +02:00
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
2024-05-07 01:00:09 +02:00
|
|
|
networks."10-wan" = hetznerWanNetwork // {
|
|
|
|
address = [ "128.140.95.112/32" "2a01:4f8:c17:6f57::1/64" ];
|
2023-07-29 19:36:51 +02:00
|
|
|
};
|
2023-07-28 23:13:28 +02:00
|
|
|
};
|
|
|
|
}
|