Help building a wifi driver

I have a usb wifi adapter that I would like to get working on nixos. It has the driver source code available here. I’m not all that linux savy - I can get as far as

make[1]: *** /lib/modules/5.4.107/build: No such file or directory.

I’ve never worked with buildFHSUserEnv before but I realize that could be an option. I tried using it in its most basic form but that wasn’t enough. Any help would really be appreciated.

I will take a more detailed look tomorrow, but as far as I know, you will need to create a custom nix derivation for it (this would allow to recompile it with just a copy of your configuration file, and automatic recompilation when linux update). I’ll try to see what I can do based on already packaged driver like the 8821ce that I’m currently using.

For anyone looking at this, there is an updated driver here: GitHub - morrownr/8812au: Linux Driver for USB WiFi Adapters that are based on the RTL8812AU Chipset

That’s a good news. And rtl8812au is already packaged in nixos. For this, I think you would need to add in the nixos configuration file :

boot.extraModulePackages = with config.boot.kernelPackages; [
    rtl8812au
];
boot.initrd.kernelModules = [ "8812au" ];

I haven’t tested this, but this should work (and don’t forget to run nixos-rebuild switch too )

1 Like

You might need to blacklist the original/generic rtl8x module.

At least I had to do it for my older Laptop.

@marius851000 @NobbZ I tried both of your suggestions but no luck. The lights on the adapter don’t even light up when I plug it into my linux machine. I’m not sure exactly what that means but I thought it was something worth noting.

I had no luck with the rtl8812au package either, however, the aircrack version does function fr-desktop: fix wifi · FRidh/nix-config@b859877 · GitHub

2 Likes

I ended up just giving up on that wifi adapter and buying one that worked well with linux.