From 394e4415d382c45ac6a7113aa1102d22a23b62f3 Mon Sep 17 00:00:00 2001 From: Alexander Wainwright Date: Thu, 9 Apr 2026 18:24:59 +1000 Subject: [PATCH] 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 --- hosts/modules/base.nix | 1 + hosts/modules/desktop.nix | 1 + hosts/modules/laptop.nix | 3 +++ readme.md | 10 ++++++++++ 4 files changed, 15 insertions(+) diff --git a/hosts/modules/base.nix b/hosts/modules/base.nix index 46a9f37..ed49e4b 100644 --- a/hosts/modules/base.nix +++ b/hosts/modules/base.nix @@ -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 diff --git a/hosts/modules/desktop.nix b/hosts/modules/desktop.nix index 2d46015..f4e5913 100644 --- a/hosts/modules/desktop.nix +++ b/hosts/modules/desktop.nix @@ -53,6 +53,7 @@ # Enable networking networking.networkmanager.enable = true; + networking.networkmanager.wifi.backend = "iwd"; # Enable CUPS to print documents. services.printing.enable = true; diff --git a/hosts/modules/laptop.nix b/hosts/modules/laptop.nix index a7dfb4b..d7dd01b 100644 --- a/hosts/modules/laptop.nix +++ b/hosts/modules/laptop.nix @@ -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"; + }; }; } diff --git a/readme.md b/readme.md index 12d38f0..e90ed4c 100644 --- a/readme.md +++ b/readme.md @@ -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: