Skip to content
Cachix

Cachix CLI

Replace MY_CACHE with your cache name in the examples on this page.

TaskCommand
Configure Nix to download from a cachecachix use MY_CACHE
Upload a build and its runtime closurecachix push MY_CACHE ./result
Protect an uploaded releasecachix pin MY_CACHE release ./result
Inspect the latest revisioncachix pins get MY_CACHE release

Run cachix --help to list commands or cachix push --help for options specific to a command.

cachix authtoken stores your access token in the Cachix configuration file, normally ~/.config/cachix/cachix.dhall. Use the global --config option to select another file. In CI, supply the token through CACHIX_AUTH_TOKEN. If your cache uses a self-generated signing key, supply it through CACHIX_SIGNING_KEY when pushing. See Configuring a cache.

Use the daemon when several commands need to submit paths to the same cache. It accepts upload requests over a local Unix socket.

Start the daemon in one terminal with cachix daemon run MY_CACHE. Leave it running while you submit paths from another terminal. When you have submitted the last path, run cachix daemon stop to finish queued uploads and shut down.

After building your project, run cachix daemon push ./result. The daemon uses the cache you selected at startup.

Run cachix daemon push --wait ./result when the next command requires that upload to have finished, for example before creating a pin. The daemon stays available for further requests.

cachix doctor inspects your installation, configuration, and authentication, and reports the most common misconfigurations along with a suggested fix:

Terminal window
$ cachix doctor

By default, Cachix loads trusted certificates from the system store (/etc/ssl/certs on Linux, the keychain on macOS, the system store on Windows).

If you are behind a TLS intercepting corporate proxy or use your own certificate authority, point Cachix at your certificate bundle using one of the following environment variables:

SSL_CERT_FILE

Path to a PEM bundle containing one or more trusted certificates.

SSL_CERT_DIR

Path to a directory of PEM certificates (each file must contain a single certificate).

Example:

Terminal window
$ export SSL_CERT_FILE=/path/to/corporate-ca-bundle.pem
$ cachix push MY_CACHE ./result

Note that cachix does not currently read NIX_SSL_CERT_FILE. If you have configured Nix with NIX_SSL_CERT_FILE, set SSL_CERT_FILE to the same path so that cachix uses the same trust store.