4 ms·
> I always end up with a huge /nix/store and have no idea how to clean it without garbage collecting everything and having to wait all over FYI you can avoid t
by chriswarbo 1y ago
> I always end up with a huge /nix/store and have no idea how to clean it without garbage collecting everything and having to wait all over
FYI you can avoid things getting garbage-collected by doing `nix-store --add-root`; that makes an "(indirect) garbage collector root"[0]. Especially useful if you're using import-from-derivation, since that imported derivation won't appear in the dependencies of your final build output (which, to be clear, is a good thing; since it lets us calculate a derivation, e.g. by solving dependency constraints or whatever, without affecting the eventual hash if that calculation happens to match a previous one!)
[0] https://nix.dev/manual/nix/2.18/package-management/garbage-collector-roots https://nix.dev/manual/nix/2.18/package-management/garbage-c...