summaryrefslogtreecommitdiff
path: root/nixos/hosts/bin/components/wireguard.nix
blob: 03371bcb6416a6dc583bf85091865e8509e97fcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
  networking.firewall.allowedUDPPorts = [ 51820 ];
  networking.firewall.trustedInterfaces = [ "wg0" ];
  
  networking.wireguard.interfaces.wg0 = {
    ips = [ "10.0.0.1/24" ];
    listenPort = 51820;
    privateKeyFile = "/var/lib/wireguard/privatekey";

    peers = [
      # PC
      {
        publicKey = "BdQ1JoAFU5XGFfZDNPEUk78zI8yLLReSWdVbeETwNX4=";
        allowedIPs = [ "10.0.0.2/32" ];
      }
      # Laptop
      {
        publicKey = " ";
        allowedIPs = [ "10.0.0.3/32" ];
      }
    ];
  };
}