Not everything in nixpkgs has be cached before nixos-unstable advances. Sometimes you might update in the window between when the channel advances and when the package you need is cached. I believe linuxPackages_latest is not required for the channel to advance. You can check if an update will require building locally with nixos-rebuild dry-build. Also, once you get a cache miss for a derivation, Nix will actually record that miss in ~/.cache/nix, so even once it is cached, you’ll still end up building locally. You can just delete this cache though without issue.
And yes, NixOS by default enables a lot of of kernel features, so it ends up being a fairly big build. Though 2 hours does seem an awful lot still… I can build it in a little over 10mins with my 16c/32t desktop, or a little over 20min on my 8 core Linux VM on an M1 Pro.
TIL: master is merged to nixos-unstable passes CI, the CI process is responsible for caching NAR archives into S3 which are then served from cache.nixos.org. The 5.16.10 only landed in master a few days ago so I looks like it hadn’t made it to the cache yet.
Huh, I did not know that. That may explain some some builds I wasn’t expecting… Is there any way to disable that, or is it a side effect of nix’ caching model or such? I can’t imagine wanting this behavior for a distribution use case.