1

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.

I should mention that I configured 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-

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.

Clearly I'm missing something.

  • Which one of the ISO's did you use? – Emmanuel Rosa Aug 25 '18 at 7:17
  • @EmmanuelRosa It was NixOS 18.03, downloaded from the download page. And it was the Graphical live CD, 64-bit Intel/AMD. – Nutritioustim Aug 26 '18 at 20:50
1

Ok, solved this one.

In /etc/nixos/configuration.nix, the setting networking.wireless.enable = true needed to be enabled at initial installation.

So I went back into the install USB, set that (in the mounted /mnt/etc/nixos/configuration.nix), and reran nixos-install.

From there, i) I rebooted into my updated system, based on the Wireless Networks section of the manual, ii) I generated a wireless configuration with wpa_passphrase <ssid> [passphrase] > /etc/wpa_supplicant.conf. Then iii) restarted the service with systemctl restart wpa_supplicant.service. Et voila!

  • 1
    I'm glad you figured it out! As you use NixOS you'll notice that it's very much an all-hands-on-deck open-source project. There is a small leadership team, but generally speaking it's a flexible, fluid project which adapts to the needs of its participants. I hereby invite you to not only use NixOS but also to contribute to the project as you see fit. For example, what you encountered is a defect in the installation documentation, thus I hope you'll consider contributing your findings to the NixOS installation documentation :) If I recall it's written in DocBook (XML). – Emmanuel Rosa Aug 27 '18 at 2:51
  • @EmmanuelRosa Thanks for the invite. I definitely like the philosophy and tech behind Nix/OS. I'll contribute where I can! – Nutritioustim Aug 28 '18 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.