Fix intermittent mDNS resolution failures

Switch NetworkManager WiFi backend to iwd to resolve repeated
wpa_supplicant disconnects caused by nl80211 send_event_marker
incompatibility with iwlwifi. Each disconnect was triggering avahi
SIGHUP reloads, causing .local name resolution to fail for several
minutes at a time.

Also disable WiFi power save in TLP and enable IPv6 mDNS resolution
via NSS (nssmdns6) for hosts that only advertise IPv6 addresses.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Alexander Wainwright 2026-04-09 18:24:59 +10:00
parent e67c840994
commit 394e4415d3
4 changed files with 15 additions and 0 deletions

View file

@ -110,6 +110,7 @@
services.avahi = {
enable = true;
nssmdns4 = true; # Enables Avahi for name service lookups (e.g., in /etc/nsswitch.conf)
nssmdns6 = true; # Also resolve IPv6 mDNS addresses via NSS
publish = {
enable = true;
addresses = true; # Publish your laptop's IP addresses

View file

@ -53,6 +53,7 @@
# Enable networking
networking.networkmanager.enable = true;
networking.networkmanager.wifi.backend = "iwd";
# Enable CUPS to print documents.
services.printing.enable = true;

View file

@ -22,6 +22,9 @@
# START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
STOP_CHARGE_THRESH_BAT0 = 81; # 80 and above it stops charging
WIFI_PWR_ON_AC = "off";
WIFI_PWR_ON_BAT = "off";
};
};
}

View file

@ -8,6 +8,16 @@ From within this directory:
sudo nixos-rebuild switch --flake .
```
# WiFi
NetworkManager is enabled. Use the terminal UI to connect:
```
nmtui
```
Select "Activate a connection", pick your network, and enter the password.
# Update and deploy
From within this directory: