2022-12-04 13:45:43 +00:00
|
|
|
{config, ...}: let
|
|
|
|
secrets = config.services.secrets.secrets;
|
2022-11-11 20:53:17 +00:00
|
|
|
in {
|
2022-12-04 13:45:43 +00:00
|
|
|
networking.firewall.trustedInterfaces = ["wg0"];
|
2022-11-11 20:53:17 +00:00
|
|
|
networking.wg-quick.interfaces = {
|
|
|
|
wg0 = {
|
2022-11-23 15:58:12 +00:00
|
|
|
autostart = false;
|
2022-12-04 13:45:43 +00:00
|
|
|
address = ["10.69.42.2/32"];
|
2022-11-17 22:25:41 +00:00
|
|
|
privateKeyFile = "${secrets.wg_priv.path}";
|
2022-11-11 20:53:17 +00:00
|
|
|
|
|
|
|
peers = [
|
|
|
|
# hetzner-vm
|
|
|
|
{
|
|
|
|
publicKey = "UJr+EmUM7KWkIy0nk0JA38ibvcLC++6iuOKkHdrx9Dc=";
|
2022-11-17 22:25:41 +00:00
|
|
|
presharedKeyFile = "${secrets.wg_preshared_hetzner-vm.path}";
|
2022-12-04 13:45:43 +00:00
|
|
|
allowedIPs = ["10.69.42.1/32"];
|
2022-11-11 20:53:17 +00:00
|
|
|
endpoint = "hetzner-vm.servers.genderfucked.monster:51820";
|
|
|
|
persistentKeepalive = 25;
|
|
|
|
}
|
|
|
|
# vault
|
|
|
|
{
|
|
|
|
publicKey = "IGq+WanFM/bKNUkwjO/0AAtDhJLvtvU+mVxH27QyHTc=";
|
2022-11-17 22:25:41 +00:00
|
|
|
presharedKeyFile = "${secrets.wg_preshared_vault.path}";
|
2022-12-04 13:45:43 +00:00
|
|
|
allowedIPs = ["10.69.42.3/32"];
|
2022-11-11 20:53:17 +00:00
|
|
|
endpoint = "vault.servers.genderfucked.monster:51820";
|
|
|
|
persistentKeepalive = 25;
|
|
|
|
}
|
2022-11-11 21:17:57 +00:00
|
|
|
# storage
|
|
|
|
{
|
|
|
|
publicKey = "biNNeCkjAWi2jUVoL5+1pBtXGa3OFZi4DltB2dqGjGg=";
|
2022-11-17 22:25:41 +00:00
|
|
|
presharedKeyFile = "${secrets.wg_preshared_storage.path}";
|
2022-12-04 13:45:43 +00:00
|
|
|
allowedIPs = ["10.69.42.4/32"];
|
2022-11-11 21:17:57 +00:00
|
|
|
endpoint = "storage.servers.genderfucked.monster:51820";
|
|
|
|
persistentKeepalive = 25;
|
|
|
|
}
|
2022-11-11 20:53:17 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|