helm/wireguard.nix
Anish Lakhwara 1ced6b7a3b helix
2021-01-09 10:18:53 +00:00

28 lines
687 B
Nix

{ config, pkgs, lib, ... }:
{
environment.systemPackages = [ pkgs.wireguard pkgs.mosh ];
networking.nat = {
enable = true;
externalInterface = "ens3";
internalInterfaces = [ "wg0" ];
};
networking.firewall = {
allowedUDPPorts = [ 60990 ];
};
networking.wireguard.interfaces.wg0 = {
ips = [ "10.0.69.1/24" ];
listenPort = 60990;
privateKeyFile = "/var/lib/wireguard/priv";
peers = [{ # bowl
publicKey = "EzvDUmHXo95S2jKRv/LkH5ItUNOBgM7aQQsaq1WfCRw=";
allowedIPs = [ "10.0.69.2/32" ];
}
{ # line
publicKey = "ViRabGV2Mv0SZUVWnoAUhIzaHEvqRXAZJLq3Bp1oN1k=";
allowedIPs = [ "10.0.69.3/32" ];
}
];
};
}