Github kind of died today, and, with it, nixpkgs. GH looks to be back now, so I’m not seeking help with this issue, but I am curious about Nix’s attitude to this single point of failure. Other package managers solve this with mirrors, so that if one server is down, a user can just sync their package lists with a different repo and continue as normal.
However, this looks non-trivial to apply to Nix. Even if channels were modified (somehow) to support mirrors, Flakes as they are wouldn’t cooperate too well given that inputs are supplied not by content but by address:
github:nixos/nixpkgs necessarily refers to a single point (of failure) located on github.com. Are there any existing thoughts on solutions that enable the mirroring of nixpkgs and resistance to this type of outage?
If there are no existing thoughts or implementations here, here’s my proposed solution for discussion: The Nix tools would allow ‘sequential aliases’ for every domain they request. If a request for a user-specified URL doesn’t return successfully, the Nix tool consults its list of sequential aliases and dequeues an aliased URL to attempt the request to. In the nixpkgs repo, we mirror to some other hosting platform, and have Nix ship a default sequential alias list containing a mapping from
github:nixos/nixpkgs[/nixos-version] to that mirror. Then, in the event of a github outage, Nix just goes down the list of mirrors like any other package manager. Thoughts?
0: I’m sort of volunteering to implement this, but my time is limited by my school at the moment, and this would be slow if I’m the only one involved in the implementation. I’m also fairly certain that this would be the type of thing to balloon in size quite easily.