From 1da2d8a098151e27b34bb70d4e76b5be49f1f016 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Sun, 27 Jun 2021 02:08:53 -0700 Subject: [PATCH] configurable excludeIP for ezwg --- modules/ezwg.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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="") '';