Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> a Nix system always ends up being 1.4GB

That's strange, I never had problems building really tiny docker (release) images with nix, in fact it felt easier than doing it with alpine. You just get exactly what you specify, no more.

(OTOH, when developing in nix, 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)



> 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-c...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: