I can’t find a way to find this kind of link:
“https://github.com/NixOS/nixpkgs/archive/2862c5e53e41a02157076f7c703b0c510a694939.tar.gz”
to use for fetching a tarball.
Just replace 2862c5e53e41a02157076f7c703b0c510a694939 with a valid git commit from that repository
the question is how to find the commit
Clone the repo and read the logs? Alternatively click on the history button: Commits · NixOS/nixpkgs · GitHub.
I’d recommend in general though using either npins or flakes, both of them will generate a lock file and update it automatically without worrying about manually discovering commit hashes.
You could also use names of branches (or e.g. channels) instead of the commit hash, for example, but of course the contents of such links would change over time.