nix-config/modules/watch-me-senpai/wireguard_server.nix

41 lines
807 B
Nix
Raw Normal View History

2022-12-07 20:06:46 +01:00
{ config, ... }:
let
port = 51820;
2022-12-07 23:30:37 +01:00
mac_addr = "03:db:db:db:db:db";
2022-12-07 20:06:46 +01:00
in
{
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
networking.firewall.allowedUDPPorts = [ port ];
2022-12-30 18:29:13 +01:00
deployment-TLMS.net = {
2022-12-20 14:56:16 +01:00
/*
2022-12-07 20:06:46 +01:00
iface.uplink = {
name = "ens3";
mac = mac_addr;
matchOn = "mac";
useDHCP = false;
addr4 = "172.20.73.70/25";
dns = [ "172.20.73.8" "9.9.9.9" ];
routes = [
{
routeConfig = {
Gateway = "172.20.73.1";
GatewayOnLink = true;
Destination = "0.0.0.0/0";
};
}
];
2022-12-20 14:56:16 +01:00
};
*/
2022-12-07 20:06:46 +01:00
wg = {
addr4 = "10.13.37.6";
prefix4 = 24;
privateKeyFile = config.sops.secrets.wg-seckey.path;
2022-12-07 23:30:37 +01:00
publicKey = "aNd+oXT3Im3cA0EqK+xL+MRjIx4l7qcXZk+Pe2vmRS8=";
2022-12-07 20:06:46 +01:00
};
};
}