configuration.nix/hosts/skipper/network/wireguard.nix

42 lines
1.1 KiB
Nix
Raw Normal View History

2024-06-20 19:41:06 +05:30
{ config, ... }: {
2024-07-02 23:20:11 +05:30
sops.secrets = {
"wireguard/skipper/pk" = {
mode = "400";
owner = config.users.users.root.name;
group = config.users.users.root.group;
};
"wireguard/skipper/psk" = {
mode = "400";
owner = config.users.users.root.name;
group = config.users.users.root.group;
};
2024-06-30 18:45:27 +05:30
};
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-07-02 23:20:11 +05:30
privateKeyFile = config.sops.secrets."wireguard/skipper/pk".path;
2024-03-31 22:28:56 +05:30
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-07-02 23:20:11 +05:30
presharedKeyFile = config.sops.secrets."wireguard/skipper/psk".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
];
};
};
};
}