Wifi Driver rtl89 Not Found

I got a new motherboard with an RTL 8922ae wifi chip, and from what I can tell, the drivers for it are in the rtl89 module, and that module should come standard in the kernel since version 5.16.[1]

However, when I add it to my module list, it gives back this output:

root module: rtl89
modprobe: FATAL: Module rtl89 not found in directory /nix/store/020lzs1bwrrgx1yv1jlprlsb3jbgkf3m-linux-6.6.79-modules/lib/modules/6.6.79

My relevant nix config is as follows when it fails:

 hardware.enableRedistributableFirmware = true;
  hardware.enableAllFirmware = true;
  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "rtl89" ];
  boot.kernelModules = [ "kvm-intel" "r8125" "rtl89" ];
  #boot.blacklistedKernelModules = [ "rtl8xxxu" ];
  boot.extraModulePackages = with config.boot.kernelPackages; [
    rtl8812au
    r8125
  ];
  boot.initrd.kernelModules = [ "8812au" "r8125" "rtl89" ];

Am I missing something? I feel like maybe there’s a simple error here that I’m not catching. I’m using the LTS kernel with NixOS 24.11.

normally you should not need this module. I would recommend to take it out of the boot config in available KernelModules, kernelModules, extraModulePackages and initrd.kernelModules.
Than test it again.

My current configuration isn’t using the module in any of the config, since it won’t build with it there.

I can see the device is accurately identified in lspci, but it doesn’t seem recognized at all otherwise. lsmod and modprobe don’t show the module, either.

ok that is strage. Can you post your config and your system specs? Especially which mainboard you got.

System info and relevant config below. I apologize that my config is a bit of a mess.
Edit: I’ll be heading to sleep after this post and will check back here in the morning to answer any questions.

System Info:

OS: NixOS 24.11 (Vicuna) x86_64
Host: X870E AORUS ELITE WIFI7 (Default string-CF-WCP-ADO)
Kernel: Linux 6.6.79
Display (QG241Y S): 1920x1080 @ 165 Hz in 28" [External] *
Display (R240HY): 1920x1080 @ 60 Hz in 24" [External]
CPU: AMD Ryzen 9 9950X (32) @ 5.75 GHz
GPU 1: AMD Radeon Graphics [Integrated]
GPU 2: NVIDIA GeForce RTX 3090 Ti [Discrete]
Memory: 27.25 GiB / 60.44 GiB (45%)

configuration.nix

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      ./unstable.nix
      #./garbage.nix
      <home-manager/nixos>
    ];

  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ];
  boot.supportedFilesystems = [ "ntfs" ];

  boot.kernel.sysctl = {
    "zswap.enabled" = 1;
    "kernel.sysrq" = 1;
  };

  #boot.kernelPackages = pkgs.linuxPackages_latest;

  nix = {
    optimise = {
      automatic = true;
      dates = [ "08:30" ];
    };
    gc = {
      automatic = true;
      dates = "Sun 07:30:00";
      options = "--delete-older-than 7d";
    };
  };

  networking.hostName = "jamie-battlestation"; # Define your hostname.
  networking.stevenblack.enable = true;
  networking.nameservers = [ "9.9.9.9" "1.1.1.1" ];
  #networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Enable networking
  networking.networkmanager.enable = true;

  virtualisation.docker = {
    daemon.settings.data-root = "/store/docker";
    enable = true;
    enableOnBoot = true;
    enableNvidia = true;
  };
  hardware.nvidia-container-toolkit.enable = true;
  virtualisation.libvirtd.enable = true;
  virtualisation.libvirtd.qemu.swtpm.enable = true;

  #systemd.enableUnifiedCgroupHierarchy = false;

  # Set your time zone.
  time.timeZone = "America/Chicago";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_US.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "en_US.UTF-8";
    LC_IDENTIFICATION = "en_US.UTF-8";
    LC_MEASUREMENT = "en_US.UTF-8";
    LC_MONETARY = "en_US.UTF-8";
    LC_NAME = "en_US.UTF-8";
    LC_NUMERIC = "en_US.UTF-8";
    LC_PAPER = "en_US.UTF-8";
    LC_TELEPHONE = "en_US.UTF-8";
    LC_TIME = "en_US.UTF-8";
  };

  # Enable the X11 windowing system.
  services.xserver.enable = true;

  services.locate.enable = true;

  # Enable the GNOME Desktop Environment.
  services.displayManager.sddm.enable = true;
  services.xserver.desktopManager.plasma5.enable = true;

  # Configure keymap in X11
  services.xserver = {
    xkb = {
      variant = "";
      layout = "us";
    };
  };

  # Enable CUPS to print documents.
  services.printing.enable = false;

  # Enable sound with pipewire.
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  # Enable touchpad support (enabled default in most desktopManager).
  # services.xserver.libinput.enable = true;

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.jamie = {
    isNormalUser = true;
    description = "Jamie";
    extraGroups = [ "networkmanager" "wheel" "docker" ];
    shell = pkgs.fish;
    packages = with pkgs; [
      firefox
      fortune
      thunderbird
    ];
  };
  home-manager.backupFileExtension = "backup";
  home-manager.users.jamie = { pkgs, ... }: {
    programs.fish.enable = true;
    home.stateVersion = "23.11";
  };

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;

  programs = with pkgs; {
  	noisetorch.enable = true;
	java.enable = true;
  	steam.enable = true;
	virt-manager.enable = true;
	fish.enable = true;
	mosh = {
	  enable = true;
	  openFirewall = false;
	};
  };
  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
    anki
    p7zip
    (pkgs.wrapOBS {
      plugins = with pkgs.obs-studio-plugins; [
        obs-ndi
      ];
    })
    ndi
    audacity
    neofetch
    du-dust
    zoxide
    mpv
    cron
    rnnoise-plugin
    flameshot
    rofi
    qjackctl
    mtr
    htop
    dool
    neovim
    git
    wget
    python312
    mpv
    vscode
    go
    appimage-run
    gcc
    spotify
    pkgs.man-pages
    pkgs.man-pages-posix
    galculator
    libreoffice-qt6-fresh
    prismlauncher
    qFlipper
    davinci-resolve
    ripdrag
    fastfetch
    feh
    godot_4
    utsushi
    element-desktop
    fd
    fzf
    gnumake
    home-manager
    rclone
    xdotool
    starsector
    chromium
    rustdesk-flutter
    steam-run
    neovide
  ];

  nixpkgs.config.permittedInsecurePackages = [
    "dotnet-runtime-7.0.20"
  ];

  environment.variables.EDITOR = "nvim";
  environment.variables.MAKEFLAGS = "-j6";
  environment.variables.NIXPKGS_ALLOW_INSECURE = "1";

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  services.openssh = {
    enable = true;
    openFirewall = false;
    settings = {
      PasswordAuthentication = true;
      PermitRootLogin = "no";
    };
  };
  services.flatpak.enable = true;

  services.tailscale = {
    enable = true;
    openFirewall = true;
    useRoutingFeatures = "both";
    #extraUpFlags = [ "--ssh" "--advertise-exit-node" ];
    #extraUpFlags = [ "--ssh" ];
  };

  # Open ports in the firewall.
  networking.firewall.interfaces.tailscale0 = {
    allowedTCPPorts = [ ];
    allowedUDPPorts = [ ];
  };
  #networking.firewall.allowedUDPPorts = [ 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  networking.firewall.enable = true;

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "23.11"; # Did you read the comment?

  nix.settings.experimental-features = [ "nix-command" "flakes" ];

  fonts = {
    enableDefaultPackages = true;
    packages = with pkgs; [
      noto-fonts-cjk-sans
      ubuntu_font_family
      unifont
    ];
    fontconfig = {
      antialias = true;
      defaultFonts = {
        serif = [ "Ubuntu" ];
	sansSerif = [ "Ubuntu" ];
	monospace = [ "Ubuntu Source" ];
      };
    };
  };

  i18n.inputMethod = {
    enable = true;
    type = "fcitx5";
    fcitx5.addons = with pkgs; [
      fcitx5-mozc
      fcitx5-gtk
    ];
  };
}

hardware-configuration.nix

{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    "/etc/nixos/nvidia.nix"
    ];

  hardware.enableRedistributableFirmware = true;
  hardware.enableAllFirmware = true;
  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
  boot.kernelModules = [ "kvm-intel" "r8125" ];
  #boot.blacklistedKernelModules = [ "rtl8xxxu" ];
  boot.extraModulePackages = with config.boot.kernelPackages; [
    rtl8812au
    r8125
  ];
  boot.initrd.kernelModules = [ "8812au" "r8125" ]; # 8812au - A USB wifi dongle
                                                    # r8125  - Ethernet module

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/7c37b5c2-7597-4189-aaa4-7e3935d6dc44";
      fsType = "ext4";
    };
  fileSystems."/tmp" = {
    device = "tmpfs";
    fsType = "tmpfs";
    options = [ "size=32G" "mode=1777" "strictatime" "nosuid" "nodev" ];
  };
  fileSystems."/home" = {
    device = "/dev/disk/by-uuid/13fc85ab-32db-425b-971a-727cd6c138f6";
    fsType = "ext4";
    options = [ "noatime" ];
  };
  fileSystems."/store" = {
    device = "/dev/disk/by-uuid/64f58ed5-7d33-42c8-99f0-c1a5de49a3dc";
    fsType = "ext4";
    options = [ "noatime" ];
  };
  fileSystems."/nix" = {
    device = "/dev/disk/by-uuid/a3e79842-8c01-4006-a962-2137037aca7f";
    fsType = "ext4";
    options = [ "noatime" ];
  };
  fileSystems."/store/big" = {
    device = "/dev/disk/by-uuid/38d6526c-c941-44c7-a859-bb0770344c97";
    fsType = "btrfs";
    options = [ "compress=zstd" "noatime" "autodefrag" ];
  };
  fileSystems."/store/nvme" = {
    device = "/dev/disk/by-uuid/aa2428a7-8f2d-48bc-a834-5a3694f30d9a";
    fsType = "ext4";
    options = [ "noatime" ];
  };
  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/D143-8E40";
      fsType = "vfat";
    };

  swapDevices = [ ];

  # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
  # (the default) this is the recommended approach. When using systemd-networkd it's
  # still possible to use this option, but it's recommended to use it in conjunction
  # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
  networking.useDHCP = lib.mkDefault true;
  # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
  # networking.interfaces.enp6s0.useDHCP = lib.mkDefault true;

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

OK
First of all can you try this:
https://www.reddit.com/r/MSI_Gaming/comments/1ga8bn1/comment/mbh3rf3/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
Also get rid of the this in your config:

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

your should not need this. Further it can cause interference, especially the 8812au which is for a USB WIFI adapter.

I’ve been doing some testing. The motherboard thread doesn’t apply to me, but I’ve noticed something else that I didn’t pick up on when I initially made this thread. The rtw89 module isn’t the only module that is not present. If I remove all of that, neither the rtw89 nor the r8125 apply, and I am completely without networking unless I USB tether through my phone.

I’m going to try loading a NixOS LiveUSB and an Arch LiveUSB to see if they have networking on boot.

Edit 1: The wifi adapter is detected successfully on Arch LiveUSB, though the r8125 isn’t. This appears to be a known issue in the Arch community that requires an AUR package to resolve. Will test a NixOS LiveUSB once it downloads.

Edit 2: The NixOS LiveUSB had no network connectivity.

OK
So you want to use the wifi module from your mainboard and not need the dongle?
If that is the case can you do this:
https://www.reddit.com/r/gigabyte/comments/1geme4q/comment/lynk2gn/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
Also can you try to plug the dongle out for that?

The dongle hasn’t actually been used in quite some time, I’m using the r8125 ethernet driver with a 50ft cord. Though I have to install the driver manually and override it’s broken flag since it was also technically supposed to be mainlined in the 5.x kernels somewhere.

Update: Wifi appears to work out of the box on the Zen kernel, however the r8125 driver does not. r8125 in the repo also will not build on the Zen kernel, so it is wifi-only.

Sorry for my late response. Had some stuff going on.
But now I could do some research. So apparently your wifi module should work out of the box:
https://patchwork.kernel.org/project/linux-wireless/cover/20250108020955.14668-1-pkshih@realtek.com/
For your Ethernet connection, you should not need any driver for an Ethernet connection.
This could however be Bios related issue. So can you try doing a Bios update.