Help for rtl8811cu driver

Hi, I recently bought this Wi-Fi dongle which has a RTL8811CU chipset but I can’t get nixos to recognize it. Here are the outputs of lsusb and dmesg:

Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 012: ID 0bda:c811 Realtek Semiconductor Corp. 802.11ac NIC
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 1a2c:2d43 China Resource Semico Co., Ltd USB Keyboard
Bus 003 Device 002: ID 04f9:0028 Brother Industries, Ltd Printer
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
[ 1944.978425] usb 2-1: new high-speed USB device number 12 using ehci-pci
[ 1945.109710] usb 2-1: New USB device found, idVendor=0bda, idProduct=c811, bcdDevice= 2.00
[ 1945.109715] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1945.109717] usb 2-1: Product: 802.11ac NIC
[ 1945.109719] usb 2-1: Manufacturer: Realtek
[ 1945.109720] usb 2-1: SerialNumber: 123456

Kernel: 6.1.31

Any help would really be appreciated

Try:

{
  boot = {
    blacklistedKernelModules = [ "rtw88_8821cu" ];
    extraModulePackages = with config.boot.kernelPackages; [ rtl8821cu ];
  };
}

Even though the website says it’s RTL8811CU, the driver for RTL8821CU works just fine. For future readers: add this to your hardware-configuration.nix:

boot.initrd.kernelModules = [ "8821cu" ];
boot.extraModulePackages = [ config.boot.kernelPackages.rtl8821cu ];
1 Like