7 with (import ./names-and-numbers.nix);
 
   8 with (import ./names-and-numbers.nix.clear);
 
  11     ../../../nixos/profiles/networking/wifi.nix
 
  13   systemd.network.networks = {
 
  17         Address = "${wifiIPv4}.1/24";
 
  21         DNS = "${wifiIPv4}.1";
 
  27         RequiredForOnline = "no";
 
  32       #      Destination = "${wifiIPv4}.0/24";
 
  33       #      # FIXME: Not supported by nixos-23.11
 
  34       #      #TCPCongestionControlAlgorithm = "westwood";
 
  40   networking.networkmanager.unmanaged = [ wifiIface ];
 
  42   networking.nftables.ruleset = lib.mkAfter ''
 
  45         iifname ${wifiIface} jump input-lan
 
  46         iifname ${wifiIface} log level warn prefix "input-lan: " counter drop
 
  49         oifname ${wifiIface} jump output-lan
 
  50         oifname ${wifiIface} log level warn prefix "output-lan: " counter drop
 
  52       chain forward-to-wifi {
 
  55       chain forward-from-wifi {
 
  59         iifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } oifname ${wifiIface} goto forward-to-wifi
 
  60         iifname ${wifiIface} oifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } goto forward-from-wifi
 
  65   # iw dev wlp5s0 station dump
 
  66   # DOC: https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf
 
  67   systemd.services.hostapd = {
 
  68     unitConfig.StartLimitIntervalSec = 5;
 
  69     serviceConfig.Restart = "always";
 
  77         networks.${wifiIface} = {
 
  79           #ignoreBroadcastSsid = "clear";
 
  84             # FIXME: use wpaPasswordFile or saePasswordsFile
 
  85             wpaPassword = wpaPassphrase;
 
  90           disassoc_low_ack = true;
 
  94           # See per band "Capabilities:" section in `iw list`
 
 109       dtim_period=2 # DTIM (delivery trafic information message)
 
 111       # limit the frequencies used to those allowed in the country
 
 113       ignore_broadcast_ssid=1
 
 115       # 0 means the AP will search for the channel with the least interferences (ACS)
 
 119       #auth_algs=0 # 0=noauth, 1=wpa, 2=wep, 3=both
 
 123       # QoS support, also required for full speed on 802.11n/ac/ax
 
 125       eap_reauth_period=360000
 
 132       # See per band "Capabilities:" section in iw list
 
 133       ht_capab=[HT40+][SHORT-GI-40][MAX-AMSDU-3839][DSSS_CCK-40]