pub async fn push_path(
storage: &dyn StorageBackend,
signer: &CacheSigner,
store_path: &str,
hash: &str,
references: &[String],
deriver: Option<&str>,
codec: NarCodec,
) -> Result<PushResult, CacheError>Expand description
Push a store path to the binary cache.
- Dump the path as NAR
- Hash the uncompressed NAR (sha256)
- Compress under
codec - Hash the compressed NAR (sha256)
- Build narinfo metadata
- Sign the narinfo
- Upload NAR blob and narinfo
The store_path should be an absolute path like /nix/store/abc-hello-1.0.
The hash is the 32-character store path hash (the abc part).
references are the runtime dependency store path basenames.
codec is the packing posture — resolved from
CacheConfig::nar_codec, never chosen
here. It is one value and it is threaded, not re-stated: the bytes, the
URL suffix and the Compression: field below all read the same parameter,
so a caller has no way to pick zstd bytes and an xz narinfo. See
NarCodec.
§Errors
CacheError::PathNotFound if store_path does not exist,
CacheError::Io if the NAR dump or compression fails, or whatever the
backend returns from the two uploads.