stdlib: use_flake: don't keep old generations around #1089
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: Unless there's consensus that this is a good idea, let's talk about it. I've just noticed these things eating up my disk space without manual intervention, and it seemed annoying. And I thought a PR is a nicer discussion base than a feature request.
(I also haven't actually run the code yet 馃槺 I'll get to that in the next days)
This is a pretty significant change for people who care about this, but I'd argue that this is very rarely the case.
The two reasons I can see why one would like to keep an old generation are
Given that use_flake is always used with a flake.nix file and most probably in a version controlled project, reverting flake.nix seems like an easier way to roll back than fiddling with generations (which would be overridden by direnv pretty soon anyways)
Garbage collection is a better reason imo, but still, actually going back to old versions is probably relatively rare, and stuff isn't collected before nix-collect-garbage is ran anyways.