With golang, you can setup your own package proxy, point GOPROXY environment to that, and then be guaranteed that even if the original host is no longer available, you can build your code. Is there an equivalent for nix?
With golang, you can setup your own package proxy, point GOPROXY environment to that, and then be guaranteed that even if the original host is no longer available, you can build your code. Is there an equivalent for nix?
If you enable the "keep-outputs" and "keep-derivations" in your Nix config then your local nix store should keep anything it used until you manually clean out old derivations (assuming you aren't accessing the tarballs via some ---impure method).
An easier option is to use a tool/service like cachix [2] to run your own repository which can be used just like the normal cache.nixos.org.
copy runtime requirements:
nix copy --to s3://some-bucket ./result
copy full build description: nix copy --to s3://some-bucket ./result --derivation
copy runtime of the buildtime: nix path-info -r nixpkgs#hello --derivation | xargs -n1 nix path-info | nix copy --to s3://some-bucket
Then you set your substituter to s3://some-bucket either in nix.conf or in CLI with --substitutersOr if you don't like s3, point it to https, ssh, or a simple local file directory.