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 networking.interfaces = {
11 ipv4.addresses = [{ address = "${wifiIPv4}.1"; prefixLength = 24; }];
14 address = "${wifiIPv4}.0";
16 options = { congctl = "westwood"; };
21 networking.nftables.ruleset = lib.mkAfter ''
24 iifname ${wifiIface} jump input-lan
25 iifname ${wifiIface} log level warn prefix "input-lan: " counter drop
28 oifname ${wifiIface} jump output-lan
29 oifname ${wifiIface} log level warn prefix "output-lan: " counter drop
31 chain forward-to-wifi {
34 chain forward-from-wifi {
38 iifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } oifname ${wifiIface} goto forward-to-wifi
39 iifname ${wifiIface} oifname { ${eth1Iface}, ${eth2Iface}, ${eth3Iface} } goto forward-from-wifi
44 networking.networkmanager.unmanaged = [ wifiIface ];
45 systemd.services.dhcpd4.onFailure = [ "network-addresses-${wifiIface}.service" ];
48 interfaces = [ wifiIface ];
50 subnet ${wifiIPv4}.0 netmask 255.255.255.0 {
51 range ${wifiIPv4}.100 ${wifiIPv4}.200;
52 option broadcast-address ${wifiIPv4}.255;
53 option domain-name-servers ${wifiIPv4}.1;
54 option routers ${wifiIPv4}.1;
55 option subnet-mask 255.255.255.0;
59 # iw dev wlp5s0 station dump
60 # DOC: https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf
64 interface = wifiIface;
65 # 0 means the AP will search for the channel with the least interferences (ACS)
71 inherit wpaPassphrase;
77 dtim_period=2 # DTIM (delivery trafic information message)
79 # limit the frequencies used to those allowed in the country
82 ignore_broadcast_ssid=1
88 auth_algs=1 # 0=noauth, 1=wpa, 2=wep, 3=both
90 # QoS support, also required for full speed on 802.11n/ac/ax
92 eap_reauth_period=360000
99 # See per band "Capabilities:" section in iw list
100 ht_capab=[HT40+][SHORT-GI-40][MAX-AMSDU-3839][DSSS_CCK-40]