1 { inputs, hostName, ... }:
7 networking.nftables.ruleset = ''
10 udp dport ${toString listenPort} counter accept comment "${wgIface}"
16 iifname ${wgIface} jump input-extra
17 iifname ${wgIface} log level warn prefix "input-extra: " counter drop
25 oifname ${wgIface} jump output-extra
26 oifname ${wgIface} log level warn prefix "output-extra: " counter drop
30 iifname ${wgIface} counter accept
34 #boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
35 systemd.services."wireguard-${wgIface}".serviceConfig.LoadCredentialEncrypted = [
36 "privateKey:${./. + "/${wgIface}/privateKey.cred"}"
38 networking.networkmanager.unmanaged = [ wgIface ];
39 networking.wireguard.interfaces.${wgIface} = {
40 # publicKey: 1Iyq96rPHfyrt4B31NqKLgWzlglkMAWjA41aF279gjM=
41 privateKeyFile = "$CREDENTIALS_DIRECTORY/privateKey";
42 ips = [ "192.168.43.1/32" ];
44 socketNamespace = null;
46 interfaceNamespace = "extra";
48 ${pkgs.iproute}/bin/ip netns add extra
54 publicKey = "Ul1+GINJ/eXy7MhUQLB6wXboLUfKW32nwHd/IAGtwSk=";
55 allowedIPs = [ "192.168.43.2/32" ];
59 publicKey = "7hdI8aInfxFG0Ua1jHMDmx1RezI1q1PObFx6Kp2g5iI=";
60 allowedIPs = [ "192.168.43.3/32" ];