Skip to content
Cachix

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.

Install Nix if you haven’t already. Then choose one of the installation methods below.

Run the following command to install the Cachix CLI in your user environment:

Terminal window
$ nix-env -iA cachix -f https://cachix.org/api/v1/install

If you use flakes, install the CLI from Nixpkgs:

Terminal window
$ nix profile install --accept-flake-config nixpkgs#cachix

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.

Check that the cachix command is available:

Terminal window
$ cachix --version
$ cachix --help