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>.narinfoand 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/storeand thus avoids the build. -
Optionally Hydra also generates
.lsfor listing contents of the store path and.logfor 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 copywill upload in parallel only when the dependency graph allows that)