I’m running version Nixos 2024.11 on my Raspberry Pi 4B. I have no need for WIFI and would like to turn off everything related to it. Yet I can’t seem to get wpa_supplicant to turn off. Everything in the docs leads me to believe that this should do the trick:
networking.wireless.enable = false;
I have set that, run nixos-switch with the approriate flags many times, and yet the wpa_supplicant package and systemd unit are still on the system and the service is still very much up and running.
Anyone have any tips as to how to remove it once and for all?
Do you reboot after a nixos-rebuild boot? I think the unit is supposed to stay alive until the next reboot to prevent ugly surprises. Maybe add a change which you would obviously see having an effect just to be sure, too, so we confirm your flags are correct.
If not, your config definitely should disable it, given the source code. Many things depend on wpa_supplicant though, maybe something else is flipping it on (though in theory that should also show you a conflict, or be overridden by your setting).
I’ve rebooted and reapplied the config many times since making that change, so I don’t think that’s the issue. Could it be that the switch is getting flipped because I have network.networkmanager.enable=true set and, once you do that, there’s no disabling the wifi?
I’ll try to switch to systemd-networkd to check. I’m also gonna look for a way to find out exactly what setting sets what flag in the config (if that exists).
Fair, I’ve helped users in the past who later realized they were editing the wrong copy of their configuration and building something completely different. Make sure this isn’t the case here, if you use non-flakes check what nixos-config is set to in $NIX_PATH.
That module doesn’t seem to support completely disabling this; I guess the idea is that nobody would run a glossy network management service without needing wireless connections. Any reason you don’t just let dhcp do its job without networkmanager mucking about? Switching to systemd-networkd will also resolve this, and is more appropriate for a server of some sort.
Not to say this shouldn’t be supported, I think a PR for an option to disable wireless in networkmanager might be accepted.
That’s what the source code is for. You can go quite far without learning to read nixpkgs, but if you care about details like this that’s what you’ll have to do.
Yep, switching to systemd-networkd solved it. I was using NetworkManager as a holdover from my laptop config, but there’s no need for that on this machine.