2022-09-18 15:13:50 -07:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
|
|
environment.systemPackages = [ pkgs.wireguard-tools 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;
|
2022-10-03 06:59:21 -07:00
|
|
|
privateKeyFile = "/var/lib/wireguard/priv";
|
2022-09-18 15:13:50 -07:00
|
|
|
generatePrivateKeyFile = true; # TODO agenix secret
|
|
|
|
peers = [
|
|
|
|
{
|
|
|
|
# box
|
2024-01-05 23:44:08 -08:00
|
|
|
publicKey = "OnvVM1UaX0nmdohzSDyl90VKwd4VUpJZ+4oBpkkytwU=";
|
2022-09-18 15:13:50 -07:00
|
|
|
allowedIPs = [ "10.0.69.4/32" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
# line
|
|
|
|
publicKey = "fsb1FuGmYi89p4CVXytKw2FYamONKtoanxrgs/dJjC8=";
|
|
|
|
allowedIPs = [ "10.0.69.3/32" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
# curve
|
2023-01-12 21:11:10 -08:00
|
|
|
publicKey = "zkC7IzXX16i2ixqnRrPlUq2fD2/4noe84FlZBFaDBEE=";
|
2022-09-18 15:13:50 -07:00
|
|
|
allowedIPs = [ "10.0.69.2/32" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
# helix
|
|
|
|
publicKey = "gcdq86hhEUlqF2chqYB/F8pALyAMNFvwLycxBoHuoDs=";
|
|
|
|
allowedIPs = [ "10.0.69.5/32" ];
|
|
|
|
}
|
2024-08-18 18:55:28 -07:00
|
|
|
{
|
|
|
|
# hyperplane
|
|
|
|
publicKey = "v+EUuM60yZLvBmdCG9GxfFAtSjS1VvbUWcyNb8emjDg=";
|
|
|
|
allowedIPs = [ "10.0.69.6/32" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
# work
|
|
|
|
publicKey = "/gv66s8DfppCCjaEN/jlc8z95IhEWPgDumykqKEl0QU=";
|
|
|
|
allowedIPs = [ "10.0.69.7/32" ];
|
|
|
|
}
|
2022-09-18 15:13:50 -07:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|