stowix nix push
Push Nix store paths and their complete closures to a Stowix binary cache repository.
Synopsis
stowix nix push [flags] <store-path> [<store-path>...]
Description
stowix nix push uploads one or more Nix store paths — along with their complete runtime closures
— to a Stowix Nix binary cache repository.
The CLI performs the following steps for each invocation:
- Resolves the full closure of every specified store path using
nix path-info --recursive. - Deduplicates paths across all provided arguments.
- Queries the server to determine which paths are already present.
- Uploads only the missing paths, compressing each as a
.nar.xznarball.
Flags
| Flag | Env Var | Required | Default | Description |
|---|---|---|---|---|
--target <url> | STOWIX_TARGET | Yes | — | Full URL of the target repository, e.g.
|
--token <token> | STOWIX_TOKEN | No | — | API token ( |
--verbose | — | No | false | Enable verbose per-path logging |
Examples
# Push a single derivation result
stowix nix push --target https://acme.stowix.io/my-cache ./result
# Push multiple store paths
stowix nix push --target https://acme.stowix.io/my-cache \
/nix/store/abc123-hello-2.10 \
/nix/store/def456-glibc-2.38
# Using environment variables
export STOWIX_TARGET=https://acme.stowix.io/my-cache
export STOWIX_TOKEN=stx_live_01JABCDEF1234567890ABCDEF_Kw3mZ9xRvN2pLqYfBsHtUeAc
nix build && stowix nix push ./result
NixOS Binary Cache Configuration
To configure a NixOS machine to use your Stowix cache as a substituter, add the following to your NixOS configuration. The public key can be found in Dashboard → Repositories → your-cache → Signing Key.
nix.settings = {
substituters = [ "https://acme.stowix.io/my-cache" ];
trusted-public-keys = [ "my-cache:BASE64PUBKEY==" ]; # from Dashboard → Repositories → my-cache → Signing Key
};
After rebuilding and switching, NixOS will transparently fetch pre-built paths from the cache
before falling back to building locally or downloading from cache.nixos.org.