Hacker News new | ask | show | jobs
by sshine 396 days ago
I've been wondering about that too.

I guess our system's nixpkgs moves forward while the nixpkgs in our project flake.nix stays the same. So eventually the nixpkgs of the project is garbage collected, because it isn't pinned by the system, and it needs to redownload and rebuild?

I don't know.

I try to `nix flake update` my system configuration every 2-3 months.

Arguably, running Arch and not updating frequently is a pain, too.

1 comments

> eventually the nixpkgs of the project is garbage collected

You should manually create a garbage collection root (that pesky 'result' symlink, --out-link)

Are you saying that the presence of a result/ symlink means the sources are kept, and if I remove the result/ symlink, it gets gc’ed?
Yes, gc root links are accounted at the moment they are written by nix and they retain the graph while they are continue to exist.