summaryrefslogtreecommitdiff
path: root/hosts/cez/modules/wireguard.nix
blob: 07ea90cb4baa57afae3e11191152d856c97a049e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ config, ... }:

let
  domain = config.userdata.domain;
in
{
  sops.secrets."misc/wireguard" = {};

  networking.wg-quick.interfaces."wg" = {
    address = [ "10.0.1.2/24" ];
    dns = [ "10.0.1.1" ];
    mtu = 1380;
    privateKeyFile = config.sops.secrets."misc/wireguard".path;

    peers = [{
      publicKey = "wJMyQDXmZO4MjYRk6NK4+J6ZKWLTTZygAH+OwbPjOiw=";
      allowedIPs = [ "0.0.0.0/0" ];
      endpoint = "${domain}:51820";
      persistentKeepalive = 25;
    }];
  };
}