Nix build Not downloading everything from cache

I have setup hydra to build my NixOS configs, with harmonia being used to serve the nix store of this server as a cache. My expectation is that on successful build of the flake, all derivations/packages/etc will be available in the nix store and cache.

When I build my laptop configuration, using the same commit of the flake, using nix build/`nh os switch’ etc. A lot of packages are downloaded from the harmonia cache, but I see others are being built locally.

Is my expectation wrong that the nix commands should just be able to download the entire NixOS configuration?

This is the line of my flake.nix containing the hydraJob:

This is the Hydra jobset config:

State: Enabled
Description:
Flake URI: github:Lyndeno/nix-config
Check interval: 3600
Scheduling shares: 1 (50.00% out of 2 shares)
Enable Dynamic RunCommand Hooks: No (not enabled by server)
Number of evaluations to keep: 10

Harmonia is set up with https through nginx. I was also getting the same behaviour when using nix-serve on port 5000 without https. I am not sure what other options I should be checking.

Some packages might have preferLocalBuild = true;, you’d have to identify what’s missing the cache first.

I did not know this was an option, I also see allowSubstitutes is available.

Just from glancing at the nom output, things like the toplevel nixos-system-... and initrd-linux, linux-...-modules, user-environment are being built locally.

Why do we use localBuild?

Assuming my nix store does not contain any of the derivations, is there a command I can run that will show me what is available in the cache, but my laptop will continue to build locally?

Found the solution: