diff options
author | azahi <azat@bahawi.net> | 2024-12-02 01:13:53 +0300 |
---|---|---|
committer | azahi <azat@bahawi.net> | 2024-12-02 01:13:53 +0300 |
commit | 0df7936405dd7cfa1ed518441a154b03f1aa57bc (patch) | |
tree | de5a0042316f821475e829885c3120aaa6725926 /modules/wireguard.nix | |
parent | 2024-11-30 (diff) |
Diffstat (limited to 'modules/wireguard.nix')
-rw-r--r-- | modules/wireguard.nix | 29 |
1 files changed, 11 insertions, 18 deletions
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; }; }; |