From 0df7936405dd7cfa1ed518441a154b03f1aa57bc Mon Sep 17 00:00:00 2001 From: azahi Date: Mon, 2 Dec 2024 01:13:53 +0300 Subject: 2024-12-02 --- modules/wireguard.nix | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'modules/wireguard.nix') diff --git a/modules/wireguard.nix b/modules/wireguard.nix index dcd7858..5138946 100644 --- a/modules/wireguard.nix +++ b/modules/wireguard.nix @@ -20,6 +20,14 @@ let ${resolvectl} dnssec ${cfg.interface} no ${resolvectl} dnsovertls ${cfg.interface} no ''; + + extraOptions = { + jc = 228; + jmin = 42; + jmax = 420; + s1 = 69; + s2 = 96; + }; in { disabledModules = [ @@ -149,13 +157,7 @@ in "${ipv4.address}/16" "${ipv6.address}/16" ]; - extraInterfaceConfig = '' - jc = 228 - jmin = 42 - jmax = 420 - s1 = 69 - s2 = 96 - ''; + inherit extraOptions; }) (with cfg.server; { peers = [ @@ -221,17 +223,8 @@ in "${ipv4.address}/16" ]; listenPort = port; - inherit peers; - postSetup = - DNSSetup - + '' - awg set ${cfg.interface} \ - jc 228 \ - jmin 42 \ - jmax 420 \ - s1 69 \ - s2 96 - ''; + inherit peers extraOptions; + postSetup = DNSSetup; allowedIPsAsRoutes = false; }; }; -- cgit 1.4.1