Installation
The Cachix CLI is the command-line client for the Cachix binary cache service. Use it to upload Nix build results, manage pins, and configure Nix to download builds from Cachix caches.
Before you start
Section titled “Before you start”Install Nix if you haven’t already. Then choose one of the installation methods below.
Install with Nix
Section titled “Install with Nix”Run the following command to install the Cachix CLI in your user environment:
$ nix-env -iA cachix -f https://cachix.org/api/v1/installInstall with flakes
Section titled “Install with flakes”If you use flakes, install the CLI from Nixpkgs:
$ nix profile install --accept-flake-config nixpkgs#cachixDeclarative installation
Section titled “Declarative installation”The CLI is available as pkgs.cachix in Nixpkgs.
Add it to the packages managed by your Nix configuration.
For example, on NixOS:
{ pkgs, ... }: { environment.systemPackages = [ pkgs.cachix ];}Apply the change with sudo nixos-rebuild switch.
For Home Manager, add pkgs.cachix to home.packages and run home-manager switch.
The CLI version comes from the Nixpkgs revision your configuration uses.
Verify the installation
Section titled “Verify the installation”Check that the cachix command is available:
$ cachix --version$ cachix --helpNext steps
Section titled “Next steps”- Use an existing cache to configure Nix to download its builds.
- Make your first push to create a cache, authenticate, and upload a build.
- Set up CI to upload builds from your CI workflow.