Changes to Garbage Collection

Based on your feedback, I have made the following two changes:

  1. When downloading <store-hash>.narinfo the timestamp of last access is updated, previously this would happen only with nar archives.

    This change allows tools like nix-build-uncached to prevent unneeded downloads and playing nicely with Cachix garbage collection algorithm!

  2. Previously, the algorithm ordered paths first by last accessed timestamp and then by creation timestamp.

    That worked well until you had all entries with last accessed and all newly created store paths will get deleted first.

    As of last Monday the algorithm orders by last accessed timestamp and if it is missing, fallbacks to creation timestamp.

    This ensures entries in your cache are always fresh, either because they were recently created or recently accessed.

You can read about garbage collection on docs.cachix.org.

If I have missed anything, let me know via your preferred communication channel.

Domen