configuration.nix/hosts/skipper/wireguard.nix

36 lines
973 B
Nix
Raw Normal View History

2024-06-20 19:41:06 +05:30
{ config, ... }: {
2024-06-30 18:45:27 +05:30
sops.secrets."wireguard/psk/skipper" = {
mode = "400";
owner = config.users.users.root.name;
group = config.users.users.root.group;
};
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=";
2024-06-30 17:53:43 +05:30
presharedKeyFile = config.sops.secrets."wireguard/psk/skipper".path;
2024-06-20 19:41:06 +05:30
persistentKeepalive = 20;
allowedIPs = [
"10.10.10.0/24"
"fd7c:585c:c4ae::0/64"
];
}
2024-03-31 22:28:56 +05:30
];
};
};
};
}