3 ms·
Yes, the nix store essentially acts as a cache. Nix can access "substituters" (e.g. remote nix stores/caches) over SSH. If you run nix-serve that's what cache.n
by KingMachiavelli 5y ago
Yes, the nix store essentially acts as a cache. Nix can access "substituters" (e.g. remote nix stores/caches) over SSH. If you run nix-serve that's what cache.nixos.org is using (nix store over HTTP). [1]
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.
[1] https://nixos.wiki/wiki/Binary_Cache https://nixos.wiki/wiki/Binary_Cache
[2] https://www.cachix.org/ https://www.cachix.org/