diff --git a/modules/ezwg.nix b/modules/ezwg.nix index 93b2a52..e7ee361 100644 --- a/modules/ezwg.nix +++ b/modules/ezwg.nix @@ -24,6 +24,12 @@ in description = "The IP of the wg server"; }; + excludeIP = mkOption { + type = types.str; + default = cfg.serverIP; + description = "The IP to _not_ route through the proxy, you normally want this to be the same as `serverIP` when not tunneling"; + }; + serverPort = mkOption { type = types.int; default = 51820; @@ -54,7 +60,7 @@ in builtins.toFile "exclusionary-wildcard-ranges-generator.py" '' import ipaddress n1 = ipaddress.ip_network('0.0.0.0/0') - n2 = ipaddress.ip_network('${cfg.serverIP}/32') + n2 = ipaddress.ip_network('${cfg.excludeIP}/32') print(':'.join(list(map(lambda x: str(x), list(n1.address_exclude(n2))))), end="") '';