Following the NixOS Manual, I i) made a live USB drive, and ii) installed NixOS on my system.
Now I’m trying to set up my wireless network, and “Wireless Networks” instructions aren’t working for my install. What did I need to do during the install, or after install, to get this working?
Specifically, I don’t have wpa_supplicant.service.
systemctl restart wpa_supplicant.service
Failed to restart wpa_supplicant.service: Unit wpa_supplicant.service not found.
When I just try to run systemctl restart NetworkingService, I get a similar error.
systemctl restart NetworkingService
Failed to restart NetworkingService: Unit NetworkingService not found.
You need to set the networking.wireless.enable option to true to get wpa_supplicant. Alternatively you can use network-manager by setting networking.networkmanager.enable to true. NetworkManager integrates better with desktop environments like GNOME and Plasma.
To apply the configuration change, make sure to use nixos-rebuild switch.
Sorry I didn’t specify that. But I had set networking.wireless.enable = true (in /etc/nixos/configuration.nix). In my case, rerunning nixos-rebuild switch doesn’t work because it can’t download packages from the internet.
$ nixos-rebuild switch
building Nix...
building the system configuration...
warning: unable to download 'https://cache.nixos.org/nix-cache-info': Couldn't resolve host name (6); retrying in 348 ms
warning: unable to download 'https://cache.nixos.org/nix-cache-info': Couldn't resolve host name (6); retrying in 619 ms
...
cannot build derivation '/nix/store/...-wpa_supplicant.service.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/...-nixos-system-18.03.132847.aec217852f2.drv': 1 dependencies couldn't be built
So it looks like I have a chicken and egg problem. I don’t have networking, that would allow me to setup networking. I would have imagined that that wpa supplicant package would have been included in the base installation.
Sorry I neglected to mention that. There has to be something else I’m missing.
Connect via a wired connection temporarily just to get this working.
Boot back into the installer, connect to the wifi there, mount your filesystems like when you originally installed, and rerun nixos-install. It will only fetch the newly necessary stuff and build a new generation of your installed system, and when you then boot back into the installed system wpa_supplicant.service should be running.
I had the same problem, as the installer provides wpa supplicant I didn’t pay attention to it during the install then once the install completed, I realized I had no software to handle wifi (annoying on these small laptops without ethernet port). The default template could emphasize that by adding a (commented) line for configuring either networkmanager or wpa_supplicant
@lheckemann Indeed that did the trick. networking.wireless.enable = true needed to be enabled at initial installation. So I went back into the install USB, set that, and reran nixos-install. Cheers.