So if I understand correctly, the idea is to cache only what’s needed from the /nix cache, since caching all of /nix is very slow. Is this in a way like “tree-shaking” the /nix directory?
In an ideal world this kind of functionality would included in nix, although I guess it’s very hard to make it work in general (presumably not every run-time dependency is discoverable through ldd).
Yes, that’s the idea. Nix does have Nix bundle feature that provides similar functionality, but it results in significantly larger bundles, for reasons unknown to me. In my case, my bundler produces a 9MB bundle while Nix bundle produces a 45 MB bundle.
So if I understand correctly, the idea is to cache only what’s needed from the /nix cache, since caching all of /nix is very slow. Is this in a way like “tree-shaking” the /nix directory?
In an ideal world this kind of functionality would included in nix, although I guess it’s very hard to make it work in general (presumably not every run-time dependency is discoverable through ldd).
score 1 · canonical
Yes, that’s the idea. Nix does have Nix bundle feature that provides similar functionality, but it results in significantly larger bundles, for reasons unknown to me. In my case, my bundler produces a 9MB bundle while Nix bundle produces a 45 MB bundle.
score 5 · canonical