System Gen194 @ 2025-05-14-00:45:09 by jonas@comfy-station
This commit is contained in:
parent
4a60a88fbe
commit
7d5e47cfdf
@ -1,6 +1,7 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.wg.server;
|
||||
@ -27,10 +28,19 @@ in {
|
||||
networking.wireguard.interfaces."wg0" = {
|
||||
ips = ["10.10.10.1/24"];
|
||||
listenPort = cfg.port;
|
||||
|
||||
inherit (cfg) privateKeyFile;
|
||||
|
||||
peers = peers.forServer;
|
||||
|
||||
# Allow p2p traffic
|
||||
postSetup = ''
|
||||
${pkgs.iptables}/bin/iptables -A FORWARD -i wg0 -o wg0 -j ACCEPT
|
||||
'';
|
||||
|
||||
# Undo the above
|
||||
postShutdown = ''
|
||||
${pkgs.iptables}/bin/iptables -D FORWARD -i wg0 -o wg0 -j ACCEPT
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user