1 { pkgs, lib, hostName, ... }:
 
   2 with (import ./names-and-numbers.nix);
 
   3 with (import ./names-and-numbers.nix.clear);
 
   6     ../../../nixos/profiles/networking/wifi.nix
 
   8   systemd.network.networks = {
 
  12         Address = "${wifiIPv4}.1/24";
 
  16         DNS = "${wifiIPv4}.1";
 
  22         RequiredForOnline = "no";
 
  27       #      Destination = "${wifiIPv4}.0/24";
 
  28       #      # FIXME: Not supported by nixos-23.11
 
  29       #      #TCPCongestionControlAlgorithm = "westwood";
 
  35   networking.networkmanager.unmanaged = [ wifiIface ];
 
  37   networking.nftables.ruleset = lib.mkAfter ''
 
  40         iifname ${wifiIface} jump input-lan
 
  41         iifname ${wifiIface} log level warn prefix "input-lan: " counter drop
 
  44         oifname ${wifiIface} jump output-lan
 
  45         oifname ${wifiIface} log level warn prefix "output-lan: " counter drop
 
  47       chain forward-to-wifi {
 
  50       chain forward-from-wifi {
 
  54         iifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } oifname ${wifiIface} goto forward-to-wifi
 
  55         iifname ${wifiIface} oifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } goto forward-from-wifi
 
  60   # iw dev wlp5s0 station dump
 
  61   # DOC: https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf
 
  62   systemd.services.hostapd = {
 
  63     unitConfig.StartLimitIntervalSec = 5;
 
  64     serviceConfig.Restart = "always";
 
  72         networks.${wifiIface} = {
 
  74           ignoreBroadcastSsid = "empty";
 
  78             # FIXME: use wpaPasswordFile or saePasswordsFile
 
  79             wpaPassword = wpaPassphrase;
 
  84           disassoc_low_ack = true;
 
  88           # See per band "Capabilities:" section in `iw list`
 
 103       dtim_period=2 # DTIM (delivery trafic information message)
 
 105       # limit the frequencies used to those allowed in the country
 
 107       ignore_broadcast_ssid=1
 
 109       # 0 means the AP will search for the channel with the least interferences (ACS)
 
 113       #auth_algs=0 # 0=noauth, 1=wpa, 2=wep, 3=both
 
 117       # QoS support, also required for full speed on 802.11n/ac/ax
 
 119       eap_reauth_period=360000
 
 126       # See per band "Capabilities:" section in iw list
 
 127       ht_capab=[HT40+][SHORT-GI-40][MAX-AMSDU-3839][DSSS_CCK-40]