Greetings everyone.
I’ve been using NixOS for a long time and I’ve put off learning things like flakes and overlays for far too long. I just recently migrated my configs to a flake based setup, and everything has been fine for the most part. My current issue is completely unrelated to that; after updating past a certain point my old NIC (8265NGW) broke because iwlwifi refused to load any firmware at all. I even went so far as to purchase a new NIC (AX210) and the problem persisted.
After some research/googling I ran into other people experiencing the same problem online and the only solution was to use an older version of linux-firmware from before the regression was introduced.
This person here seems to have accomplished that with overlays, but I couldn’t figure out how to get their example to work, and it doesn’t seem to be an idiomatic/correct way anyways.
I’d be grateful for any help/suggestions/explanations on how to incorporate overlays into my current configuration (as linked above)
Regards,
Vratnik
The connection between overlays and NixOS isn’t that complicated. You set nixpkgs.overlays
the same way you set any other NixOS option, in any module that works for the way you choose to lay out your configuration. You don’t need to do anything special with file structure or change anything about the flake interface to your config.
Writing an overlay itself is covered in the Nixpkgs manual. Start small and post configs if something you think ought to work doesn’t.
So I just tried adding the overlay again and getting it to work assuming that I’d just been overthinking things, and it seems like it’s not being acknowledged/respected at build time at all.
Here’s the relevant commit in my config.
What am I failing to understand?
Thanks in advance
You intended to add the overlay to tobenaitori
and not to fbk
, right? If so, it looks correct to me; what are you seeing that makes you think it isn’t working?
Well, when I do nixos-rebuild
it doesn’t result in a new generation. And after rebooting, it’s still not using the correct version of linux-firmware as the iwlwifi issue persists.
I imagine the correct behaviour would be downloading and building the specified version of linux-firmware which would result in a new generation.
Well, the overlay is definitely defined, so if your rebuild doesn’t change anything then I think you may never have been using the linux-firmware
package in the first place. I think you’ve correctly created an overlay for a package you aren’t actually using.
Maybe adding linux-firmware
to hardware.firmware
would have solved your original problem by itself! But if not, that’s the most straightforward way to get linux-firmware
involved in your config. (The other way would be to set one of hardware.enableRedistributableFirmware
or hardware.enableAllFirmware
.)
1 Like
This was absolutely the issue.
After explicitly adding hardware.firmware = [ pkgs.linux-firmware ];
everything worked as expected.
Thank you so much for your patience and for helping me figure this out! 
1 Like