nix-conf/system/modules/wireguard.nix
2025-01-03 13:59:16 +08:00

16 lines
277 B
Nix

{ ... }:
let
configPath = "/etc/wireguard/wg0.conf";
in
{
networking.firewall = {
allowedUDPPorts = [ 51820 ];
};
networking.wg-quick.interfaces.wg0 =
if builtins.pathExists configPath then
{
configFile = configPath;
}
else
{ };
}