(no title)
puetzk | 2 years ago
It doesn't, actually - all the fetchers are [fixed-output derivations](https://nixos.org/manual/nix/stable/language/advanced-attrib...) where you specify not only the source, but the hash it is expected to produce. And so the fetched files will be hashed and placed in the nix store under that hash. And therefore subsequent builds using that artifact will use the already-stored artifact and not care if the source is reachable or not. You know that all "external" inputs will be captured by fixed-output derivations, because any derivation that isn't fixed-output is blocked from network access.
For anything built by the hydra CI, this will be retained on central cache.nixos.org. Or you can copy from a store of some machine that has it.
Now, if it's something not on the official cache.nixos.org, and the source is gone, and you've lost (or pruned) your store, you will need to get the file from somewhere and put it back in your store: https://nixos.org/manual/nix/stable/command-ref/nix-store/ad.... Or you just change the source URL (this won't change the derivations depending on it, because the input being transferred is identified by the hash that is to be delivered, not by the URL it comes from).
8organicbits|2 years ago
If I'm following correctly, this would prevent issues like builds failing due to the leftpad package getting unpublished, since you'd use the cache/archive instead of failing to fetch the missing package.
> and you've lost (or pruned) your store
It's common for academic code, for example, to be built once, published and then shelved. The "you" in "your store" ends up being different people over time.
Apt generally has this issue too, while Debian keeps old packages around (snapshot archive), third parties origins and other apt based systems may not.
I'm going to explore nix more, thank you!
tripleo1|2 years ago