I don’t see my laptop wifi when ip link and before I figure out the problem, I’d like to use USB Wi-Fi.
(networking.networkmanager.enabled is enabled)
I tried several USB WiFi sticks that I have but nothing worked so I’m assuming NixOS doesn’t have the kernel modules that for example Ubuntu in default installation has.
I found option:
boot.kernelModules
But I’m not sure if I should use it for something that should be loadable. In other words I don’t think I should see the modules in lsmod before I actually stick the USB Wi-Fi in.
Could you please advise what to do?
Also do you have names of common Wi-Fi kernel modules I could add?
Check lspci (onboard) and lsusb (usb) output for the name and vid/pid of your WiFi adapters. Then use that to figure out what drivers you need - or why they aren’t loaded.
Post the output of those commands if you can’t find the right driver yourself.
Forcibly loading random WiFi modules is of little use (they should be automatically loaded).
That’s something that is definitely true on a traditional distribution but is that true on NixOS?
My assumption is that things missing in configuration (all config, including the generated hardware config) are simply not present and therefore can’t be loaded.
That USB adapter requires rtl8192cu. The Intel card works with iwlwifi (it’s loaded, too!).
As for the USB adapter: that driver should be automatically loaded by systemd-udevd when you plug it in. Adding it to boot.kernelModules probably forces a modprobe, but that shouldn’t be necessary.
For PCI: the driver is loaded and bound to the PCI device, so it should show up in ip link. Is there anything interesting in dmesg related to iwlwifi?
Jun 30 07:39:35 nixos kernel: iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-so-a0-gf-a0-39.ucode failed with error -2
Jun 30 07:39:35 nixos kernel: iwlwifi 0000:00:14.3: no suitable firmware found!
Jun 30 07:39:35 nixos kernel: iwlwifi 0000:00:14.3: minimum version required: iwlwifi-so-a0-gf-a0-39
Jun 30 07:39:35 nixos kernel: iwlwifi 0000:00:14.3: maximum version supported: iwlwifi-so-a0-gf-a0-72
Jun 30 07:39:35 nixos kernel: iwlwifi 0000:00:14.3: check git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
I might need more current kernel since I’m running 6.1 (due ZFS issues in 6.2).
In other words Nix here works like as a normal distro - has all normal drivers / modules. Thank you.
I do now and Wi-FI is working. You fixed my Wi-Fi. Youuuhuuu. Thank you very much!
Btw. could you please explain why there is no boot.availableKernelModules, just boot.kernelModules?. For sure there are some modules that are not in the kernel and based on you explanation boot.kernelModules is like running modprobe on each specified module.
Thank you. I had a feeling that the kernel might be somehow skimmed down so people can be explicit what to add. In other words NixOS kernel is like traditional distro kernel. I’m slightly surprised since everything else in NixOS is just soooo different.