Service wpa_supplicant gives restart error after rebuild

After running nixos-rebuild switch, under some circumstances, the wpa_supplicant service is restarted. When that happens, I’m getting a systemd error:

Failed to open config file '/etc/wpa_supplicant.conf', error: No such file or directory

Here’s the full output of systemct status wpa_supplicant.service:

● wpa_supplicant.service - WPA Supplicant
   Loaded: loaded (/nix/store/acpiv0f8w4l977c84bqspqgj3vkqj5zc-unit-wpa_supplicant.service/wpa_supplicant.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2020-05-02 11:49:41 CEST; 7min ago
  Process: 13426 ExecStart=/nix/store/2iz42l61bicrz6wmfkh7fifbgw38mrp0-unit-script-wpa_supplicant-start (code=exited, status=255/EXCEPTION)
 Main PID: 13426 (code=exited, status=255/EXCEPTION)
       IP: 0B in, 0B out
      CPU: 4ms

May 02 11:49:41 jsf-nixOS systemd[1]: Started WPA Supplicant.
May 02 11:49:41 jsf-nixOS wpa_supplicant[13426]: Successfully initialized wpa_supplicant
May 02 11:49:41 jsf-nixOS wpa_supplicant[13426]: Failed to open config file '/etc/wpa_supplicant.conf', error: No such file or directory
May 02 11:49:41 jsf-nixOS wpa_supplicant[13426]: Failed to read or parse configuration '/etc/wpa_supplicant.conf'.
May 02 11:49:41 jsf-nixOS systemd[1]: wpa_supplicant.service: Main process exited, code=exited, status=255/EXCEPTION
May 02 11:49:41 jsf-nixOS systemd[1]: wpa_supplicant.service: Failed with result 'exit-code'.

The folder is indeed not present in my system. But I didn’t change any settings besides enabling networking.wireless.enable = true in my configuration.nix.

2 Likes