diff --git a/nixos/doc/manual/release-notes/rl-2105.xml b/nixos/doc/manual/release-notes/rl-2105.xml index 54abbb6e38e4..bdc2386f24c8 100644 --- a/nixos/doc/manual/release-notes/rl-2105.xml +++ b/nixos/doc/manual/release-notes/rl-2105.xml @@ -181,6 +181,15 @@ GNOME desktop environment was upgraded to 40, see the release notes for 40.0 and 3.38. The gnome3 attribute set has been renamed to gnome and so have been the NixOS options. + + + Enabling wireless networking now requires specifying at least one network + interface using . + This is to avoid a race condition with the card initialisation (see + issue + #101963 for more information). + + If you are using to assign diff --git a/nixos/modules/services/networking/wpa_supplicant.nix b/nixos/modules/services/networking/wpa_supplicant.nix index 8a0685c3d96b..d9308b37064a 100644 --- a/nixos/modules/services/networking/wpa_supplicant.nix +++ b/nixos/modules/services/networking/wpa_supplicant.nix @@ -40,8 +40,7 @@ in { default = []; example = [ "wlan0" "wlan1" ]; description = '' - The interfaces wpa_supplicant will use. If empty, it will - automatically use all wireless interfaces. + The interfaces wpa_supplicant will use. ''; }; @@ -220,7 +219,14 @@ in { }; config = mkIf cfg.enable { - assertions = flip mapAttrsToList cfg.networks (name: cfg: { + assertions = [ + { assertion = cfg.interfaces != []; + message = '' + No network interfaces for wpa_supplicant have been configured. + Please, specify at least one using networking.wireless.interfaces. + ''; + } + ] ++ flip mapAttrsToList cfg.networks (name: cfg: { assertion = with cfg; count (x: x != null) [ psk pskRaw auth ] <= 1; message = ''options networking.wireless."${name}".{psk,pskRaw,auth} are mutually exclusive''; }); @@ -255,20 +261,7 @@ in { then echo >&2 "<3>/etc/wpa_supplicant.conf present but ignored. Generated ${configFile} is used instead." fi iface_args="-s -u -D${cfg.driver} ${configStr}" - ${if ifaces == [] then '' - for i in $(cd /sys/class/net && echo *); do - DEVTYPE= - UEVENT_PATH=/sys/class/net/$i/uevent - if [ -e "$UEVENT_PATH" ]; then - source "$UEVENT_PATH" - if [ "$DEVTYPE" = "wlan" -o -e /sys/class/net/$i/wireless ]; then - args+="''${args:+ -N} -i$i $iface_args" - fi - fi - done - '' else '' - args="${concatMapStringsSep " -N " (i: "-i${i} $iface_args") ifaces}" - ''} + args="${concatMapStringsSep " -N " (i: "-i${i} $iface_args") ifaces}" exec wpa_supplicant $args ''; };