nix has a cache too but only if the packages are reproducible.
Much harder to get reproducibility with C++ than JavaScript to say the least.