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

Can relate. I’ve recently taken ownership of a new work laptop with Ubuntu (with “experimental” zfs) and using dedupe on my nix store has been an absolute blessing!


Nix already has some builtin deduplication, see `man nix-store-optimise`. Nix’s own hardlinking optimization reduces disk usage of the store (for me) by 30–40%.


Update. Turns out PyCharm does not play nice with a plethora of symlinks. :(


Nix optimise does not use symlinks, it uses hardlinks.


Well, TIL. Being relatively new to nix, you’ve let me down another rabbit hole :)


Isn't it better to use `nix store optimise` for dedup of the nix store? The nix command has more knowledge of the structure of the nix store so should be able to do a better job with fewer resources. Also the store is immutable so you don't actually need reflinks - hard links are enough.


It is, yeah, though you have to turn it on. I'm not actually sure why it's off by default.


It’s off by default as it can make builds slower (regardless of platform)—you should test this if you care. There also are (or were) some bugs on macOS that would cause corruption.


That seems like the wrong default. Most people do very little building on their desktops; they get all their software from the cache.




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

Search: