2022-12-04 13:45:43 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
secrets = config.services.secrets.secrets;
|
2022-11-17 22:25:41 +00:00
|
|
|
in {
|
2022-12-04 13:45:43 +00:00
|
|
|
environment.systemPackages = with pkgs; [wireguard-tools];
|
2022-11-10 11:25:33 +00:00
|
|
|
networking.wg-quick.interfaces = {
|
|
|
|
wg-harry-vpn = {
|
|
|
|
autostart = false;
|
2022-12-04 13:45:43 +00:00
|
|
|
address = ["185.186.9.71/26" "2a0b:6b84:2022:6::1/64"];
|
|
|
|
dns = ["8.8.8.8"];
|
2022-11-10 11:25:33 +00:00
|
|
|
mtu = 1280;
|
2022-11-17 22:25:41 +00:00
|
|
|
privateKeyFile = "${secrets.wg_harry_priv.path}";
|
2022-11-10 11:25:33 +00:00
|
|
|
|
2022-12-04 13:45:43 +00:00
|
|
|
peers = [
|
|
|
|
{
|
|
|
|
publicKey = "7B6KSFqTHM7A7Nv24GIeUhDDh2XnlT7UqG5U+Si+zmc=";
|
|
|
|
presharedKeyFile = "${secrets.wg_harry_preshared.path}";
|
|
|
|
allowedIPs = ["0.0.0.0/0" "::/0"];
|
|
|
|
endpoint = "185.186.9.1:8081";
|
|
|
|
persistentKeepalive = 25;
|
|
|
|
}
|
|
|
|
];
|
2022-11-10 11:25:33 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|