configuration.nix/hosts/skipper/wireguard.nix

31 lines
814 B
Nix
Raw Normal View History

2024-06-20 19:41:06 +05:30
{ config, ... }: {
2024-03-31 22:28:56 +05:30
networking.firewall.trustedInterfaces = [ "wg0" ];
networking.wireguard = {
enable = true;
interfaces = {
wg0 = {
ips = [
"10.10.10.2/24"
"fd7c:585c:c4ae::2/64"
];
listenPort = 51822;
2024-06-20 19:41:06 +05:30
privateKeyFile = "/persist/secrets/wireguard/private.key";
2024-03-31 22:28:56 +05:30
generatePrivateKeyFile = true;
peers = [
2024-06-20 19:41:06 +05:30
{
name = "Proxy";
2024-06-21 20:20:10 +05:30
endpoint = "165.232.180.97:51821";
2024-06-20 19:41:06 +05:30
publicKey = "NNw/iDMCTq8mpHncrecEh4UlvtINX/UUDtCJf2ToFR4=";
presharedKeyFile = config.sops.secrets."wireguard/psk".path;
persistentKeepalive = 20;
allowedIPs = [
"10.10.10.0/24"
"fd7c:585c:c4ae::0/64"
];
}
2024-03-31 22:28:56 +05:30
];
};
};
};
}