nixos-configuration/graystripe/wireguard.nix

25 lines
590 B
Nix
Raw Normal View History

2023-02-11 01:24:46 +00:00
{ config, pkgs, ... }:
{
networking.firewall = {
allowedUDPPorts = [ 51820 ];
};
networking.wg-quick.interfaces = {
wg0 = {
address = [ "192.168.5.9/24" ];
dns = [ "192.168.5.1" ];
privateKeyFile = "/etc/wireguard/privatekey";
peers = [
{
publicKey = "lQYGzNIxgUrDmU32rlnmnc72dK7TSH7hxts3tMtE+VQ=";
allowedIPs = [ "192.168.5.0/24" "192.168.6.0/24" "192.168.20.0/24" ];
2023-09-17 18:30:20 +00:00
# endpoint = "wg.asonix.dog:51820";
endpoint = "76.210.190.151:51820";
2023-02-11 01:24:46 +00:00
persistentKeepalive = 25;
}
];
};
};
}