nix-community / cache-nix-action

Cache Nix store in GitHub Actions to speed up workflows [maintainer=@deemp]
MIT License
29 stars 6 forks source link

Garbage collection approaches #4

Closed deemp closed 10 months ago

deemp commented 11 months ago

Here's a discussion of garbage collection approaches.

Problem statement

When restoring a Nix store from a cache, the store may contain old unnecessary paths. These paths should be removed sometimes to limit cache size and ensure the fastest restore/save steps.

Approach 1

Produce a cache once, use it multiple times. Don't collect garbage.

Advantages:

Disadvantages:

Approach 2

Collect garbage before saving a cache.

Advantages:

Disadvantages:

Hopefully working solutions

deemp commented 10 months ago

Moved to README in 3c9ac930d57b0e79677f01aa8edad7c35a3855c5