The benefit of the github fetcher is that it will get a tarball.
This is actually a misconception, depending on what you mean [0]; I had the same misunderstanding myself for a while, because what we actually do is fairly counter-intuitive.
GitHub hosts ${ver}.tar.gz
files for all commit releases, and while we do download this via fetchFromGitHub -> fetchzip
[1], the thing that we actually end up with is the recursive hash of the directory that comes from unpacking it. We do this so that GitHub doesn’t change their compression method or some timestamp metadata and produce an irreproducible hash [2], but what we really should do is just round-trip it through an unpack → deterministic repack.
Aside from being ~10x larger on disk than the compressed tarball, the unpacked recursive directory hash also cannot be mirrored through hashed mirrors like tarballs.nixos.org or – hopefully someday – the Software Heritage [3].
[0] Downloading the tar.gz and unpacking it is still much faster than a git clone with full history, of course, so we benefit today on that dimension.
[1] nixpkgs/pkgs/build-support/fetchgithub/default.nix at 79969356682e7ea642a0ee934080cc769a689790 · NixOS/nixpkgs · GitHub
[2] https://github.com/NixOS/nixpkgs/blob/79969356682e7ea642a0ee934080cc769a689790/pkgs/build-support/fetchzip/default.nix#L1-L20
[3] Use Software Heritage as a fallback download location · Issue #53653 · NixOS/nixpkgs · GitHub