Network fails to work almost instantly after connected

Hello everybody! There is a problem with my NixOS installation. I can connect to ethernet and wifi connections fine, and they usually work for a few seconds to a minute after connected. However, it will start to fail after that, and command line applications using the internet seem to fail. Librewolf also seems to kinda fail, in that it sometimes connects and sometimes doesn’t, kinda the luck of the draw. It seems to be really particular about what will connect and not.
For example:
I can easily get the flatpakref for VLC with:

wget https://dl.flathub.org/repo/appstream/org.videolan.VLC.flatpakref

but as soon as i flatpak install org.videolan.VLC.flatpakref
it will start running, but then say it failed to install org.kde.Platform.

Another example.
I can go to crates.io and find different crates (the connection is spotty though), like the syn crate for example.

However, if i do ‘cargo add syn’ inside a cargo project,
“”
warning: spurious network error (1 tries remaining): [7] Could not connect to server (Failed to connect to index.crates.io port 443 after 0 ms: Could not connect to server)
error: failed to get syn as a dependency of package hello v0.1.0 (/home/rootofinfinity/hello)

Caused by:
download of config.json failed

Caused by:
failed to download from https://index.crates.io/config.json

Caused by:
[7] Could not connect to server (Failed to connect to index.crates.io port 443 after 0 ms: Could not connect to server)
“”
This is a really weird issue. I can ping index.crates.io, and even wget https://index.crates.io/config.json.
I completely reinstalled NixOS on my drive to see if that would fix anything, but it is still struggling. The network works perfectly fine on Linux Mint running on the same machine, which is even more puzzling (but only the ethernet works on mint, the wifi has the same problems).

If you want to see my configuration, it’s right here:

Would love some help or even a ‘That sucks dude’.
Appreciate it.

Standard bunch of debugging context:

  • Is this at a single location?
  • Have you tried connecting just Ethernet without WiFi or vice-versa?
  • WiFi and Ethernet eventually go via a single ISP connection?
  • Have you checked what is the DNS resolver used? Maybe install host and check if name resolution works/doesn’t/works intermittently
  • Have you checked with mtr how well you can reach, say, w3.org or something? I recommend checking both IPv4 and IPv6 paths. (For a.root-servers.net you can try 198.41.0.4 and 2001:503:ba3e::2:30)

(Note: I do not use NixOS mainline nor NetworkManager, but identifying more precisely what is broken should be useful in any case)