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:

  1. Resolves the full closure of every specified store path using nix path-info --recursive.
  2. Deduplicates paths across all provided arguments.
  3. Queries the server to determine which paths are already present.
  4. Uploads only the missing paths, compressing each as a .nar.xz narball.

Flags

FlagEnv VarRequiredDefaultDescription
--target <url>STOWIX_TARGETYes

Full URL of the target repository, e.g. https://acme.stowix.io/my-cache

--token <token>STOWIX_TOKENNo

API token (stx_live_...) for authentication

--verboseNofalseEnable 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.