There’s no specification/documentation, what exactly are you interested in? I can help answer if there are specific questions.
But in general your description is close but incomplete:
-
Given a
/nix/store/<hash>-<name>
output store path, before Nix builds it it will ask substituters if they already have a binary available. -
Nix will then lookup
https://domain/<hash>.narinfo
and if it exists, check the signature against given public key and download the nar file from the url in the narinfo. -
Nar is unpacked directly into
/nix/store
and thus avoids the build. -
Optionally Hydra also generates
.ls
for listing contents of the store path and.log
for the log how it was built.
Then Nix also supports POST/PUT requests to populate the binary cache via nix copy
command essentially uploading the contents as-is.
Note that cachix push
performs much faster:
- bulk query all missing store paths in one request (instead of N requests for N store paths)
- upload all paths in parallel (
nix copy
will upload in parallel only when the dependency graph allows that)