Better WIFI UX on the non-graphical installer

It can’t configure EAP networks, but I hope that is fine for the installer.

1 Like

I recently added (21.11, I think) a decent way to configure wireless networks using the (preconfigured) wpa_supplicant daemon and wpa_cli.

It’s not super user friendly but it certainly better than editing /etc/wpa_supplicant.conf and connecting to a WPA enterprise network is no more difficult than the home network equivalent.

I’d be happy if you manage to improve the UX but the replacement should not make WPA enterprise worse, IMHO.

1 Like

The current method was the following, right? It wasn’t really complicated, we should provide something easier if anything.

wpa_passphrase SSID password > /tmp/somewhere.conf
wpa_supplicant -B -i wlp4s0 -c /tmp/somewhere.conf

The current method was the following, right?

You can still do that, but since 134030 the manual and the login screen recommends systemctl start wpa_supplicant and using wpa_cli.

Starting wpa_supplicant manually requires knowing the interface, in some cases the driver name and sacrificing a tty, which it’s pretty clearly worse. Generating the config with wpa_passphrase is simple enough but, again, no WPA2 enterprise nor WPA3 support.

The simplest way forward would be to replace wpa_cli with a less low-level tool, but I’m not aware of any.

2 Likes

One thing that is really scary about wpa_supplicant is:

# inside the wpa_cli repl
> <TAB>
[ 2 km of barely intelligible screenroll  ]

I think until I can improve the ifwifi experience, nmtui should really be our recommended way.

@hexa @rnhmjoj to clarify: nmtui does not support WPA2 Enterprise nor WPA3?

I think personal networks work, enterprise networks do not.

I just checked (was easy enough after all), actually it looks like it does:

image

Okidoki, so I pivoted the PR to make use of nmtui-connect (simple case) and nmtui (enterprise): nixos,doc: use networkmanager and nmtui on the non-graphical installer for better UX by blaggacao · Pull Request #199777 · NixOS/nixpkgs · GitHub

Yeah, for some reasons wpa_cli will spam you with the daemon log, but you can just ignore it. The commands are pretty low level but you can also scan networks, check the connection status.

nmtui does not support WPA2 Enterprise nor WPA3?

No no, I was talking about wpa_passphrase and the other tool. nmtui is probably the best UX but requires bringing NetworkManager into the minimal installer. I’m not sure why it was never done, I suppose the closure size is quite large.

2 Likes

The absolute closure is probably not even near the actual impact, though. What’s again the command sequence to check the diff of a typical minimal installer in nixpkgs?

I’m not sure, try something like

nix path-info -f nixos/release.nix iso_minimal.x86_64-linux
1 Like
nixpkgs on  mod-doc-ifwifi-installer [$]
❯ nix path-info --closure-size --human-readable -f nixos/release.nix iso_minimal.x86_64-linux
error: path '/nix/store/gxc939amrx95d3gahdfwv04k4r9qgkaq-nixos-minimal-22.11pre130979.gfedcba-x86_64-linux.iso' is not valid

:confused:

You have to build it first:

nix build -f nixos/release.nix iso_minimal.x86_64-linux

then the same command but with path-info -rS should give you the closure size.

1 Like

Thanks, I ended up comparing the ISO:

https://github.com/NixOS/nixpkgs/pull/199777#issuecomment-1306627412

200Mb is kind of heavy.

Another idea would be to patch wifi-rs to work with wpa_supplicant

Yeah, at the end of the day it’s 200MB for a small tui program: not exactly ideal. Remember that this is for the minimal installer.

We should probably be looking into connman and/or iwd too, maybe they have better tools for a smaller closure size.

iwctl seems pretty easy to use, I don’t know about WPA enterprise, though.

1 Like

ifwifi via wifiscanner uses iw already. I suspect that’s comparatively minimal.

iwd (iNet wireless daemon) is a wireless daemon for Linux written by Intel. The core goal of the project is to optimize resource utilization by not depending on any external libraries and instead utilizing features provided by the Linux Kernel to the maximum extent possible.

iwd can work in standalone mode or in combination with comprehensive network managers like ConnMan, systemd-networkd and NetworkManager.

https://wiki.archlinux.org/title/iwd#WPA_Enterprise

iwctl --passphrase passphrase station device connect SSID

:partying_face:

I have been using iwd on nixos for a while now and it is really great. A few things though:

I have noticed some issues when used in conjunction with the default nixos networking infrastructure. On boot I would often need to restart iwd. Eventually I switched over to networkd + resolved and everything is working much more smoothly. I have still had to restart iwd a few times, but it isn’t happening every boot. This all might be due to my wifi card: Intel Corporation Wi-Fi 6 AX210/AX211/AX411. For whatever reason, systemd networking stack seems to be able to deal with startup better.

1 Like

Thanks for the feedback. Yeah, I’m aware that iwd a few problems compared to wpa_supplicant (including suspend/resume), but for the installer this should be good enough: as far as It doesn’t use networkd.

2 Likes

I brought this up some time ago, replace wpa_supplicant with iwd in the (minimal) iso image · Issue #105560 · NixOS/nixpkgs · GitHub for some prior discussion
and nixos/installation-device: replace wpa_supplicant by iwd by xaverdh · Pull Request #105561 · NixOS/nixpkgs · GitHub for my draft pr

1 Like