configuration.nix/hosts/skipper/wireguard.nix

32 lines
863 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";
endpoint = "proxy.adtya.xyz:51821";
publicKey = "NNw/iDMCTq8mpHncrecEh4UlvtINX/UUDtCJf2ToFR4=";
presharedKeyFile = config.sops.secrets."wireguard/psk".path;
persistentKeepalive = 20;
2024-06-20 21:28:10 +05:30
dynamicEndpointRefreshSeconds = 20;
2024-06-20 19:41:06 +05:30
allowedIPs = [
"10.10.10.0/24"
"fd7c:585c:c4ae::0/64"
];
}
2024-03-31 22:28:56 +05:30
];
};
};
};
}