Hi! Like most nix users (I think), I use github as the authoritative source for package definitions.
However, github seems to have become more and more unreliable lately, and I can’t afford to waste time whenever they happen to be down.
Yeah, for the “main” source of packages (don’t know what the proper name for this is) I could set e.g. NIX_PATH=“nixpkgs=https://gitlab.com/lama-corp/infra/mirrors/nixpkgs/-/archive/nixos-19.09/nixpkgs-nixos-19.09.tar.gz”.
But wherever “github.com” is hardcoded there’s no way to use a mirror. You’d have to manually (or programmatically) actually replace all occurrences.
As you say, it would be great to allow multiple URLs in fetchTarball like fetchurl supports. Think it’s worth a github issue?
While reliability of GitHub is definitively becoming an issue (recent experience: my Gist has been removed - not even made private - following an anonymous troll complain), the idea of NixPkgs mirroring unlikely will get a wide support: too many of developers have its copy or fork in their private/local repos, so even disappearance of GitHub wouldn’t affect them
The bigger problem is tons of content referred in fetchFromGitHub…
This would actually be possible since we can address the content with the fixed output derivation hash. We are currently pushing our tarballs to Software Heritage (nixpkgs-swh | [maintainer=@nlewo]) and fortunately, it is almost possible to fallback on the Software Heritage archive for the fetchFromGitHub fetcher (but there are still some remaining works to achieve…).
There are some details in this blog post also https://www.tweag.io/blog/2020-06-18-software-heritage/.