Network Connection Unstable

I have been using NixOS for a year now, but since recently my internet connection stops working after a few minutes, until I reconnect. This also happens pretty often and is a persistent issue I am having since a few months now. I am connected to my modem via wifi and there are no notable changes I made to any network configuration. My user is in the network-manager group and I also enabled the corresponding service, this configuration is still from the generated configuration from one year ago.

Has anybody made similar experiences, how could I determine the issue at hand?

SPEC:

OS: NixOS 25.11 (Xantusia) x86_64 (unstable nixpkgs flake based config)
Host: Aspire A515-45G (V1.52)
Kernel: Linux 6.12.40
WM: Hyprland 0.50.1 (Wayland)
CPU: AMD Ryzen 7 5700U (16) @ 4.37 GHz
GPU 1: AMD Radeon 550X Series [Discrete]
GPU 2: AMD Lucienne [Integrated]

hi @permafrozen - is this issue reproducible on a wired connection?

Some other items to look into:

  • Could be an issue with outdated drivers for the wireless module. You
    should be able to interrogate this with lshw:
# output here is from a vm
# run as `root` or prepend `sudo`
[root@nixos:~]# nix --extra-experimental-features flakes 
--extra-experimental-features nix-command shell nixpkgs#lshw --command 
lshw -C network
   *-network
        ...
      *-virtio0
           ...
           configuration: autonegotiation=off broadcast=yes 
driver=virtio_net driverversion=1.0.0 ip=... link=yes multicast=yes

Then cross reference the installed driver version with your vendor. If
there is a newer one available, should try updating to the latest.

  • Given the issue is more recent, it’s possible there is new wireless
    interference (ie, new neighbors crappy ISP modem/gateway using the same
    WiFi channels). Most modern APs usually have a way of auto selecting the
    least crowded channel, but this is something you would need to investigate.

Thank you for your help, I will definitely try that out when I have time. :grinning:

I found my the name of my Network Controller via lspc:


[nix-shell:~]$ sudo lspci -nn | grep Network
04:00.0 Network controller [0280]: MEDIATEK Corp. MT7921 802.11ax PCI Express Wireless Network Adapter [14c3:7961]

Than I checked my version, like you recommended with lshw and I compared it to the Linux Hardware Database, through which I found out that a lot of people have problems with that specific controller and it seems like I also have the most recent drivers available installed.

[nix-shell:~]$ sudo lshw -c network | grep driverversion
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=6.12.40 firmware=rtl8168h-2_0.0.2 02/26/15 latency=0 link=no multicast=yes port=twisted pair
       configuration: broadcast=yes driver=mt7921e driverversion=6.12.40 firmware=____010000-20250625153703 ip=192.168.0.12 latency=0 link=yes multicast=yes wireless=IEEE 802.11

I guess this is a hardware problem, but I wonder why it worked properly for some time before.

hi @permafrozen it does appear you have the latest per this snippet:

… driver=mt7921e driverversion=6.12.40 firmware=____010000-20250625153703

Please share the output of these commands:

uname -a; lsmod; modinfo mt76; modinfo mt7921e

As you mentioned, a quick search on this particular vendor and driver shows many people with similar issues. Even a very similar issue on this discourse (which may help you in diagnosing further):

(sent this yesterday via e-mail, but seems discourse mailing list feature missed it)

hi @permafrozen it does appear you have the latest per this snippet:

… driver=mt7921e driverversion=6.12.40
firmware=____010000-20250625153703

Please share the output of these commands:

uname -a; lsmod; modinfo mt76; modinfo mt7921e

As you mentioned, a quick search on this particular vendor and driver
shows many people with similar issues. Even a very similar issue on this
discourse (which may help you in diagnosing further):

1 Like

Thank you a lot for helping me, sorry for the late reply, I didn’t get notified for whatever reason.

uname -a; lsmod; modinfo mt76; modinfo mt7921e

If somebody else without a lot of experience in trouble shooting reads this, the commands do the following:

  • uname -a → prints certain system information
  • lsmod → prints all loaded kernel modules
  • modinfo → prints detailed information to the specified kernel module

The above commands you provided produces the following output:

Linux nixos 6.12.41 #1-NixOS SMP PREEMPT_DYNAMIC Fri Aug  1 08:48:47 UTC 2025 x86_64 GNU/Linux
Module                  Size  Used by
rfcomm                 98304  7
snd_seq_dummy          12288  0
snd_hrtimer            12288  1
snd_seq               110592  7 snd_seq_dummy
ccm                    20480  6
xt_CHECKSUM            12288  1
xt_MASQUERADE          16384  3
ipt_REJECT             12288  2
nf_reject_ipv4         12288  1 ipt_REJECT
nft_chain_nat          12288  2
nf_nat                 65536  2 nft_chain_nat,xt_MASQUERADE
af_packet              69632  6
cmac                   12288  3
algif_hash             12288  1
algif_skcipher         12288  1
af_alg                 28672  6 algif_hash,algif_skcipher
bnep                   28672  2
nls_iso8859_1          12288  1
nls_cp437              16384  1
vfat                   24576  1
fat                   106496  1 vfat
snd_sof_amd_acp70      16384  0
snd_sof_amd_acp63      16384  0
snd_soc_acpi_amd_match     8192  1 snd_sof_amd_acp63
snd_sof_amd_vangogh    16384  0
snd_sof_amd_rembrandt    16384  0
snd_sof_amd_renoir     16384  0
amdgpu              15527936  37
xt_conntrack           12288  3
snd_sof_amd_acp        69632  5 snd_sof_amd_acp70,snd_sof_amd_rembrandt,snd_sof_amd_vangogh,snd_sof_amd_acp63,snd_sof_amd_renoir
nf_conntrack          204800  3 xt_conntrack,nf_nat,xt_MASQUERADE
snd_sof_pci            24576  5 snd_sof_amd_acp70,snd_sof_amd_rembrandt,snd_sof_amd_vangogh,snd_sof_amd_acp63,snd_sof_amd_renoir
snd_sof_xtensa_dsp     16384  1 snd_sof_amd_acp
nf_defrag_ipv6         24576  1 nf_conntrack
nf_defrag_ipv4         12288  1 nf_conntrack
snd_sof               466944  2 snd_sof_amd_acp,snd_sof_pci
snd_hda_codec_realtek   225280  1
snd_sof_utils          16384  1 snd_sof
snd_pci_ps             24576  0
snd_amd_sdw_acpi       16384  2 snd_sof_amd_acp,snd_pci_ps
snd_hda_codec_generic   110592  1 snd_hda_codec_realtek
soundwire_amd          45056  2 snd_sof_amd_acp,snd_pci_ps
soundwire_generic_allocation    12288  1 soundwire_amd
snd_hda_scodec_component    20480  1 snd_hda_codec_realtek
ip6t_rpfilter          12288  1
soundwire_bus         151552  2 soundwire_generic_allocation,soundwire_amd
snd_hda_codec_hdmi     94208  1
ipt_rpfilter           12288  1
snd_soc_core          454656  2 snd_sof,soundwire_amd
snd_hda_intel          69632  2
snd_intel_dspcfg       40960  2 snd_hda_intel,snd_sof
snd_usb_audio         548864  1
mt7921e                24576  0
snd_intel_sdw_acpi     16384  1 snd_intel_dspcfg
uvcvideo              184320  0
snd_compress           36864  1 snd_soc_core
ac97_bus               12288  1 snd_soc_core
snd_hda_codec         217088  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
mt7921_common          90112  1 mt7921e
videobuf2_vmalloc      20480  1 uvcvideo
snd_pcm_dmaengine      16384  1 snd_soc_core
btusb                  77824  0
uvc                    12288  1 uvcvideo
snd_usbmidi_lib        53248  1 snd_usb_audio
videobuf2_memops       16384  1 videobuf2_vmalloc
snd_rpl_pci_acp6x      16384  0
xt_pkttype             12288  2
videobuf2_v4l2         40960  1 uvcvideo
btrtl                  32768  1 btusb
mt792x_lib             65536  2 mt7921e,mt7921_common
snd_ump                36864  1 snd_usb_audio
snd_acp_pci            12288  0
snd_hda_core          147456  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
btintel                73728  1 btusb
videobuf2_common       94208  4 videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,videobuf2_memops
xt_LOG                 16384  2
snd_acp_legacy_common    16384  1 snd_acp_pci
mt76_connac_lib        94208  3 mt792x_lib,mt7921e,mt7921_common
snd_rawmidi            53248  2 snd_usbmidi_lib,snd_ump
nf_log_syslog          20480  2
btbcm                  24576  1 btusb
btmtk                  36864  1 btusb
snd_pci_acp6x          20480  0
snd_hwdep              20480  2 snd_usb_audio,snd_hda_codec
snd_seq_device         16384  3 snd_seq,snd_ump,snd_rawmidi
snd_pci_acp5x          20480  0
xt_tcpudp              16384  3
mt76                  135168  4 mt792x_lib,mt7921e,mt7921_common,mt76_connac_lib
videodev              401408  2 videobuf2_v4l2,uvcvideo
snd_pcm               192512  14 snd_sof_amd_acp,snd_hda_codec_hdmi,snd_pci_acp6x,snd_hda_intel,snd_usb_audio,snd_hda_codec,snd_sof,snd_compress,snd_soc_core,snd_sof_utils,soundwire_amd,snd_hda_core,snd_pci_ps,snd_pcm_dmaengine
snd_rn_pci_acp3x       24576  0
nft_compat             20480  18
bluetooth            1044480  42 btrtl,btmtk,btintel,btbcm,bnep,btusb,rfcomm
snd_timer              57344  3 snd_seq,snd_hrtimer,snd_pcm
snd_acp_config         20480  10 snd_rn_pci_acp3x,snd_sof_amd_acp70,snd_pci_acp6x,snd_pci_acp5x,snd_sof_amd_rembrandt,snd_sof_amd_vangogh,snd_sof_amd_acp63,snd_acp_pci,snd_pci_ps,snd_sof_amd_renoir
mc                     86016  5 videodev,snd_usb_audio,videobuf2_v4l2,uvcvideo,videobuf2_common
snd_soc_acpi           16384  3 snd_sof_amd_acp,snd_acp_config,snd_pci_ps
snd                   151552  25 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_hda_codec_realtek,snd_sof,snd_timer,snd_compress,snd_soc_core,snd_ump,snd_pcm,snd_rawmidi
snd_pci_acp3x          20480  0
soundcore              16384  1 snd
joydev                 28672  0
mousedev               24576  0
mac80211             1622016  4 mt792x_lib,mt76,mt7921_common,mt76_connac_lib
nf_tables             385024  256 nft_compat,nft_chain_nat
libcrc32c              12288  3 nf_conntrack,nf_nat,nf_tables
sch_fq_codel           24576  3
amdxcp                 12288  1 amdgpu
drm_exec               12288  1 amdgpu
gpu_sched              61440  1 amdgpu
edac_mce_amd           40960  0
drm_buddy              24576  1 amdgpu
drm_suballoc_helper    12288  1 amdgpu
edac_core             110592  0
amd_atl                57344  1
intel_rapl_msr         20480  0
drm_ttm_helper         16384  2 amdgpu
r8169                 131072  0
cfg80211             1372160  4 mt76,mac80211,mt7921_common,mt76_connac_lib
intel_rapl_common      53248  1 intel_rapl_msr
vboxnetflt             36864  0
ttm                   106496  2 amdgpu,drm_ttm_helper
crct10dif_pclmul       12288  1
crc32_pclmul           12288  0
polyval_clmulni        12288  0
ee1004                 16384  0
polyval_generic        12288  1 polyval_clmulni
realtek                49152  1
drm_display_helper    286720  1 amdgpu
ghash_clmulni_intel    16384  0
sp5100_tco             20480  0
mdio_devres            12288  1 r8169
acer_wmi               45056  0
vboxnetadp             32768  0
sha512_ssse3           53248  0
of_mdio                24576  1 mdio_devres
platform_profile       12288  1 acer_wmi
sha256_ssse3           36864  0
fixed_phy              16384  1 of_mdio
cec                    77824  1 drm_display_helper
i2c_piix4              36864  0
sha1_ssse3             32768  0
sparse_keymap          12288  1 acer_wmi
wdat_wdt               20480  0
fwnode_mdio            16384  1 of_mdio
aesni_intel           126976  8
gf128mul               16384  2 polyval_generic,aesni_intel
hid_multitouch         32768  0
rfkill                 40960  6 acer_wmi,bluetooth,cfg80211
i2c_algo_bit           24576  1 amdgpu
crypto_simd            16384  1 aesni_intel
tpm_crb                28672  0
cryptd                 28672  3 crypto_simd,ghash_clmulni_intel
wmi_bmof               12288  0
evdev                  24576  44
vboxdrv               675840  2 vboxnetadp,vboxnetflt
rapl                   20480  0
libarc4                12288  1 mac80211
watchdog               49152  2 sp5100_tco,wdat_wdt
libphy                233472  6 r8169,mdio_devres,fwnode_mdio,of_mdio,realtek,fixed_phy
k10temp                16384  0
tiny_power_button      12288  0
tpm_tis                16384  0
i2c_hid_acpi           12288  0
i2c_smbus              20480  1 i2c_piix4
video                  81920  2 acer_wmi,amdgpu
acer_wireless          16384  0
thermal                28672  0
rtc_cmos               32768  1
i2c_hid                45056  1 i2c_hid_acpi
wmi                    32768  3 video,acer_wmi,wmi_bmof
tpm_tis_core           36864  1 tpm_tis
battery                28672  0
input_leds             12288  0
led_class              20480  7 r8169,snd_hda_codec_generic,mt76,videodev,input_leds,libphy,acer_wmi
ac                     16384  0
button                 28672  0
mac_hid                12288  0
uinput                 20480  2
tun                    65536  0
tap                    32768  0
macvlan                36864  0
serio_raw              20480  0
loop                   40960  0
kvm_amd               245760  0
ccp                   176128  1 kvm_amd
kvm                  1355776  1 kvm_amd
irqbypass              12288  1 kvm
bridge                397312  0
stp                    12288  1 bridge
llc                    16384  2 bridge,stp
fuse                  221184  3
configfs               65536  1
efi_pstore             12288  0
nfnetlink              20480  3 nft_compat,nf_tables
efivarfs               32768  1
tpm                   143360  3 tpm_tis,tpm_crb,tpm_tis_core
libaescfb              12288  1 tpm
ecdh_generic           16384  3 bluetooth,tpm
ecc                    49152  1 ecdh_generic
rng_core               20480  2 ccp,tpm
dmi_sysfs              32768  0
ip_tables              28672  0
x_tables               53248  11 xt_conntrack,ip6t_rpfilter,nft_compat,xt_LOG,xt_tcpudp,xt_CHECKSUM,ipt_REJECT,ipt_rpfilter,xt_pkttype,ip_tables,xt_MASQUERADE
autofs4                61440  0
ext4                 1122304  1
crc32c_generic         12288  0
crc16                  12288  3 bluetooth,amdgpu,ext4
mbcache                16384  1 ext4
jbd2                  204800  1 ext4
hid_generic            12288  0
usbhid                 86016  0
hid                   270336  4 i2c_hid,usbhid,hid_multitouch,hid_generic
ahci                   57344  0
libahci                65536  1 ahci
xhci_pci               24576  0
atkbd                  40960  0
libata                483328  2 libahci,ahci
libps2                 24576  1 atkbd
vivaldi_fmap           12288  1 atkbd
nvme                   73728  2
scsi_mod              335872  1 libata
xhci_hcd              393216  1 xhci_pci
nvme_core             245760  3 nvme
crc32c_intel           16384  3
scsi_common            16384  2 scsi_mod,libata
i8042                  57344  1 acer_wmi
nvme_auth              24576  1 nvme_core
serio                  28672  4 serio_raw,atkbd,i8042
dm_mod                221184  0
dax                    53248  1 dm_mod
filename:       /run/booted-system/kernel-modules/lib/modules/6.12.41/kernel/drivers/net/wireless/mediatek/mt76/mt76.ko.xz
license:        Dual BSD/GPL
description:    MediaTek MT76x helpers
depends:        mac80211,led-class,cfg80211
intree:         Y
name:           mt76
retpoline:      Y
vermagic:       6.12.41 SMP preempt mod_unload 
filename:       /run/booted-system/kernel-modules/lib/modules/6.12.41/kernel/drivers/net/wireless/mediatek/mt76/mt7921/mt7921e.ko.xz
license:        Dual BSD/GPL
description:    MediaTek MT7921E (PCIe) wireless driver
author:         Lorenzo Bianconi <lorenzo@kernel.org>
author:         Sean Wang <sean.wang@mediatek.com>
firmware:       mediatek/WIFI_MT7922_patch_mcu_1_1_hdr.bin
firmware:       mediatek/WIFI_RAM_CODE_MT7922_1.bin
firmware:       mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin
firmware:       mediatek/WIFI_RAM_CODE_MT7961_1.bin
firmware:       mediatek/WIFI_MT7961_patch_mcu_1a_2_hdr.bin
firmware:       mediatek/WIFI_RAM_CODE_MT7961_1a.bin
alias:          pci:v000014C3d00007920sv*sd*bc*sc*i*
alias:          pci:v000014C3d00000616sv*sd*bc*sc*i*
alias:          pci:v000014C3d00000608sv*sd*bc*sc*i*
alias:          pci:v00000B48d00007922sv*sd*bc*sc*i*
alias:          pci:v000014C3d00007922sv*sd*bc*sc*i*
alias:          pci:v000014C3d00007961sv*sd*bc*sc*i*
depends:        mt76-connac-lib,mt7921-common,mt792x-lib,mt76
intree:         Y
name:           mt7921e
retpoline:      Y
vermagic:       6.12.41 SMP preempt mod_unload 
parm:           disable_aspm:disable PCI ASPM support (bool)

I’ve been having exactly the same problem on my dell latitude since ive migrated to nixos a year ago.
Pretty annoying as it happens randomly, and the only fix i have is to reboot the machine