git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/wireless: only warn for no interfaces

A hard failure breaks the NixOS installer, which can't possibly know the interface names in advance.

commitbe01320a6c39867eac0a20b4dfe04680d3b1ce26 authorrnhmjoj <rnhmjoj@inventati.org> dateMon 7 Jun 2021, 16:01 (5 years ago) parenteba5f5c
1 file changed+13
nixos/modules/services/networking/wpa_supplicant.nix+13
nixos/modules/services/networking/wpa_supplicant.nix+13
@@ -42,6 +42,11 @@ in {
4242 description = ''
4343 The interfaces <command>wpa_supplicant</command> will use. If empty, it will
4444 automatically use all wireless interfaces.
45+ <warning><para>
46+ The automatic discovery of interfaces does not work reliably on boot:
47+ it may fail and leave the system without network. When possible, specify
48+ a known interface name.
49+ </para></warning>
4550 '';
4651 };
4752
@@ -225,6 +230,14 @@ in {
225230 message = ''options networking.wireless."${name}".{psk,pskRaw,auth} are mutually exclusive'';
226231 });
227232
233+ warnings =
234+ optional (cfg.interfaces == [] && config.systemd.services.wpa_supplicant.wantedBy != [])
235+ ''
236+ No network interfaces for wpa_supplicant have been configured: the service
237+ may randomly fail to start at boot. You should specify at least one using the option
238+ networking.wireless.interfaces.
239+ '';
240+
228241 environment.systemPackages = [ package ];
229242
230243 services.dbus.packages = [ package ];