Cachix & Nix Install actions for GitHub

Hi y’all,

I’ve just pushed two GitHub actions:

a) Cachix action that allows you to run nix-build with the help of binary caches from Cachix. It’s such a simple way with a few lines of configuration to get a pretty decent Nix CI set up in a minute.

b) Install Nix action takes care of installing Nix as a step. This sounds like it should be simple, but there are quite a few caveats, so I’ve decided to abstract those away into a simple step. It’s part of Cachix’s action.

You can now instantly get access at, although it’s still in beta.


Released cachix-action-v2 with the following changes:

  • fix cachix: CppStdException "Exception: path '/nix/store/... ' is not valid; type: nix::InvalidPath"
  • don’t error out if signing key is missing (typical on pull requests)

Released install-nix-v3 with the following changes:

  • speed up builds by setting max-jobs = auto in /etc/nix/nix.conf
  • properly avoid segfault when installing Nix

Thank you all for such swift feedback :slight_smile:


We’re starting to discuss v3, which would allow more use cases:

  • having multiple caches to substitute from
  • getting store paths from somewhere else than plain nix-build

So if the current cachix action doesn’t cover your use case, please take look at v3 proposal:

- uses: cachix/cachix-action@v3
        mode: configure
        use: mycache mycache2
- ...
- uses: cachix/cachix-action@v3
        name: mycache
        sourceCommand: nix-build ci.nix
        signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'

And comment on:

1 Like