Skip to content
Jörg Thalheim edited this page Sep 22, 2026 · 2 revisions

Streaming push

niks3 push --stdin reads store paths line by line, pushes them in batches as they arrive (--batch-size, --parallel-pushes) and writes one JSON line per path to stdout:

{"path":"/nix/store/…","status":"ok"}
{"path":"/nix/store/…","status":"error","message":"…"}

When the server has signing keys, an ok line also carries the signatures it made for the path, so a producer can add them to its own store:

{"path":"/nix/store/…","status":"ok","signatures":["cache-1:…"]}

The field is left out for paths the cache already had and when the server does not sign.

A line that is itself JSON is a request and is pushed as one unit, all or nothing, with its id echoed in every result. claim_token is optional and ties the push to a build claim:

{"id":7,"paths":["/nix/store/…-foo","/nix/store/…-foo-dev"],"claim_token":42}

Closures the cache already has are skipped without walking them locally (POST /api/objects/present).

Clone this wiki locally