summaryrefslogtreecommitdiff
path: root/nixos/hosts/box/components/wireguard.nix
blob: 37db0a1d8e283308dffe59175c789c7608da0bc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  networking.firewall.allowedUDPPorts = [ 51820 ];

  networking.wireguard.interfaces.wg0 = {
    ips = [ "10.0.0.2/24" ];
    privateKeyFile = "/var/lib/wireguard/privatekey";

    peers = [
      {
        publicKey = "P2LPLBq/6qXE5Mmv8DJUviU89Yu5s7vysbyWncnZchY=";
        allowedIPs = [ "10.0.0.0/24" ];
        endpoint = "5.231.118.254:51820";
        persistentKeepalive = 25;
      }
    ];
  };
}