diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index e0f633ff7ffe6..bda82c6a2eba9 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -200,10 +200,15 @@ - `services.avahi.ipv6` now defaults to true. +- Per-interface `wpa_supplicant` systemd services generated by the `networking.wireless` + configuration no longer blocks the `multi-user.target` and will start/stop the unit on demand as + the specified wireless interface appears or disappears. + - `bind.cacheNetworks` now only controls access for recursive queries, where it previously controlled access for all queries. - `programs.fzf.keybindings` now supports the fish shell. + ## Nixpkgs Library {#sec-release-25.05-lib} diff --git a/nixos/modules/services/networking/wpa_supplicant.nix b/nixos/modules/services/networking/wpa_supplicant.nix index 536aebe4931c4..3cf47dbd6b7fc 100644 --- a/nixos/modules/services/networking/wpa_supplicant.nix +++ b/nixos/modules/services/networking/wpa_supplicant.nix @@ -118,11 +118,12 @@ let { description = "WPA Supplicant instance" + optionalString (iface != null) " for interface ${iface}"; - after = deviceUnit; before = [ "network.target" ]; wants = [ "network.target" ]; - requires = deviceUnit; - wantedBy = [ "multi-user.target" ]; + after = deviceUnit; + bindsTo = deviceUnit; + upheldBy = deviceUnit; + wantedBy = optional (iface == null) "multi-user.target"; stopIfChanged = false; path = [ pkgs.wpa_supplicant ];