Revert "nixos/wireless: make wireless.interfaces mandatory"
This reverts commit 030a521adc9510207dd9f06b8d8b552ff7d999f9. (cherry picked from commit eba5f5c1e5a61ef65a970c699b9f93aff87448bf)
This commit is contained in:
parent
e041608a92
commit
df9df54d63
|
@ -181,15 +181,6 @@
|
||||||
<para>GNOME desktop environment was upgraded to 40, see the release notes for <link xlink:href="https://help.gnome.org/misc/release-notes/40.0/">40.0</link> and <link xlink:href="https://help.gnome.org/misc/release-notes/3.38/">3.38</link>. The <code>gnome3</code> attribute set has been renamed to <code>gnome</code> and so have been the NixOS options.</para>
|
<para>GNOME desktop environment was upgraded to 40, see the release notes for <link xlink:href="https://help.gnome.org/misc/release-notes/40.0/">40.0</link> and <link xlink:href="https://help.gnome.org/misc/release-notes/3.38/">3.38</link>. The <code>gnome3</code> attribute set has been renamed to <code>gnome</code> and so have been the NixOS options.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Enabling wireless networking now requires specifying at least one network
|
|
||||||
interface using <xref linkend="opt-networking.wireless.interfaces"/>.
|
|
||||||
This is to avoid a race condition with the card initialisation (see
|
|
||||||
<link xlink:href="https://github.com/NixOS/nixpkgs/issues/101963">issue
|
|
||||||
#101963</link> for more information).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If you are using <option>services.udev.extraRules</option> to assign
|
If you are using <option>services.udev.extraRules</option> to assign
|
||||||
|
|
|
@ -40,7 +40,8 @@ in {
|
||||||
default = [];
|
default = [];
|
||||||
example = [ "wlan0" "wlan1" ];
|
example = [ "wlan0" "wlan1" ];
|
||||||
description = ''
|
description = ''
|
||||||
The interfaces <command>wpa_supplicant</command> will use.
|
The interfaces <command>wpa_supplicant</command> will use. If empty, it will
|
||||||
|
automatically use all wireless interfaces.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -219,14 +220,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
assertions = [
|
assertions = flip mapAttrsToList cfg.networks (name: cfg: {
|
||||||
{ 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;
|
assertion = with cfg; count (x: x != null) [ psk pskRaw auth ] <= 1;
|
||||||
message = ''options networking.wireless."${name}".{psk,pskRaw,auth} are mutually exclusive'';
|
message = ''options networking.wireless."${name}".{psk,pskRaw,auth} are mutually exclusive'';
|
||||||
});
|
});
|
||||||
|
@ -261,7 +255,20 @@ in {
|
||||||
then echo >&2 "<3>/etc/wpa_supplicant.conf present but ignored. Generated ${configFile} is used instead."
|
then echo >&2 "<3>/etc/wpa_supplicant.conf present but ignored. Generated ${configFile} is used instead."
|
||||||
fi
|
fi
|
||||||
iface_args="-s -u -D${cfg.driver} ${configStr}"
|
iface_args="-s -u -D${cfg.driver} ${configStr}"
|
||||||
args="${concatMapStringsSep " -N " (i: "-i${i} $iface_args") ifaces}"
|
${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}"
|
||||||
|
''}
|
||||||
exec wpa_supplicant $args
|
exec wpa_supplicant $args
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue