Problems with wi-fi on Plasma 6

I have installed NixOS Plasma on an Asus laptop.

  1. Wi-fi is detected and shows as connected.
  2. There is no actual connection though i.e. cannot reach to the internet.
  3. I plug an ethernet cable, the connection switches to it and I have internet.
  4. I unplug the cable, it automatically switches back to the wi-fi, I have internet.
  5. After a couple of minutes, it asks for the password again, I connect, I don’t have internet.

I can consistently repeat this behavior i.e. wi-fi shows as connected but only functions when/briefly after having the ethernet cable plugged.

Any ideas? I have not had this problem with other Linux distributions on the same laptop, btw.

Are you using NetworkManager? Plasma works best with it and all the UIs only really work with NetworkManager.

How did you configure NetworkManager encrypting WiFi passwords?

Did you try deleting the wifi connection and adding it back?

What says the NetworkManager or dmesg log?

Are you using NetworkManager?

Yes. networking.networkmanager.enable = true.

How did you configure NetworkManager encrypting WiFi passwords?

Defaults, “Store password for this user only (encrypted)”.

Did you try deleting the wifi connection and adding it back?

Yes, no luck.

What says the NetworkManager or dmesg log?

I do see the following error:

iwlwifi 000:00:14.3: WRT: Invalid buffer destination

Troubleshooting, I also noticed that I could actually ping an IP address. So I thought it could be a DNS resolution issue. I added the configuration from systemd-resolved - NixOS Wiki to /etc/nixos/configuration.nix and run nixos-rebuild switch - the network manager fails to start.