From 227e0108e9b32be5f3ad7bf7343c821884b7d9ba Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 1 Mar 2022 20:12:50 -0600 Subject: [PATCH] add workflow for pushing nix flake artifacts to Cachix (#1721) * add workflow for pushing nix flake artifacts to Cachix * add docs on using the cachix cache from nix * remove submodule clone from cachix workflow * remove flake check --- .github/workflows/cachix.yml | 24 ++++++++++++++++++++++++ book/src/install.md | 7 ++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cachix.yml diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml new file mode 100644 index 00000000..dcc24eb9 --- /dev/null +++ b/.github/workflows/cachix.yml @@ -0,0 +1,24 @@ +# Publish the Nix flake outputs to Cachix +name: Cachix +on: + push: master + +jobs: + publish: + name: Publish Flake + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install nix + uses: cachix/install-nix-action@v16 + + - name: Authenticate with Cachix + uses: cachix/cachix-action@v10 + with: + name: helix + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - name: Build nix flake + run: nix build diff --git a/book/src/install.md b/book/src/install.md index 1a5a9daa..8b7d8fa2 100644 --- a/book/src/install.md +++ b/book/src/install.md @@ -19,7 +19,12 @@ brew install helix A [flake](https://nixos.wiki/wiki/Flakes) containing the package is available in the project root. The flake can also be used to spin up a reproducible development -shell for working on Helix. +shell for working on Helix with `nix develop`. + +Flake outputs are cached for each push to master using +[Cachix](https://www.cachix.org/). With Cachix +[installed](https://docs.cachix.org/installation), `cachix use helix` will +configure Nix to use cached outputs when possible. ### Arch Linux