NixOS Build Stuck on Cache Resource Download

So I have been installing NixOS the last couple of days and have experienced a little bit of frustration due to one issue that sometimes appears randomly.

I’ve installed NixOS in virtualbox did that successfully, included i3 in my config, enabled x11 and all was good.

And then Created another VM and this time I chosen to go for Wayland instead of enabling x11, and swaywm was my pick, all was good again.

Then I tried installing NixOS on qemu and did the same installs and everything worked just fine.

I’ve just installed NixOS more than once now, but what happened yesterday was the reason why I am posting this, I was just installing NixOS again on a new VM, but then the build took too long (+4 hours) I then canceled the build and re-run it again, and found out that it is stuck on downloading one resource from cache.nixos.org, no matter how many times I re-run the build command sudo nixos-rebuild switch it always gets stuck on that resource forever. But when I decided to not enable x11 + and removed i3, from NixOS config, the rebuild would then just work again without this issue.

So then I decided to try Wayland + Swaywm again on this new VM and it worked, so I thought maybe it has something to do with x11, until I decided to install nixos on my real hardware and discover that I got the same issue even though I did not enable x11, I only added swaywm.

Extra information: I install nixos with very minimal configuration everytime, I don’t enable windowing system or any display managers until I first get a successful OS install, then I can edit the NixOS config again if I wanted to add any window managers or such.

The resource that isn’t downloading and I was referring is shown in the image: Imgur: The magic of the Internet and on the cover of this post.

if you can suggest me something, or know anything that could help me to fix this issue, please let me know, if you would like me to provide information on something specific also let me know, and I will try my best, Thanks!

I just tried running sudo nix-collect-garbage and do the rebuild a few more times, and wait for 7000+ symlinks to finish, and finally the build had finished.