nix-cache-beacon is a binary cache that uses mDNS service discovery to announce & find caches on the local network & races gets against discovered caches, turning your entire network of Nix nodes into a distributed binary cache.
It’s still marked as alpha, but I’ve been using this at home for the last couple of weeks without much issue.
If you have a desktop and a laptop at home. What happens if you use your laptop outside home? Do you have a bunch of timeouts or your home’s caches are just not discovered and thus, are ignored?
Because I found that all the existing implementations were not quite following the spec (don’t remember the details, it was a while ago). Feel free to steal the code if you’re not happy with the library you’re using
Would it make sense if we were able to configure nix-cache-beacon to also look for nix caches that might not always be available. Like when running attic on your lan. So that when we leave home with our laptop, nix doesn’t try to reach those caches for like 5 minutes.
If you announce your attic cache on your LAN, and you leave your home the attic cache will be removed from the in-memory cache index.
Later when you get back your attic cache will be rediscovered and added back.