Skip to content

Commit 2fb8864

Browse files
committed
use Cachix in GitHub Action
1 parent b99b637 commit 2fb8864

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

.github/workflows/nix-shell.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,16 @@ jobs:
1212
nix-shell:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/[email protected]
16-
# https://github.com/cachix/install-nix-action/issues/56
17-
- run: |
18-
sudo mkdir -p /nix/store
19-
sudo chmod -R 777 /nix
20-
21-
- name: Cache nix env take N+1
22-
uses: actions/[email protected]
23-
with:
24-
path: /nix/store
25-
# See https://github.com/actions/cache/pull/726
26-
# /nix/store/**
27-
# Missing something?
28-
# /nix/var/nix/*/*
29-
# /nix/var/nix/db/*
30-
# /nix/var/nix/db/*/**
31-
# !/nix/var/nix/daemon-socket/socket
32-
# !/nix/var/nix/userpool/*
33-
# !/nix/var/nix/gc.lock
34-
# !/nix/var/nix/db/big-lock
35-
# !/nix/var/nix/db/reserved
36-
key: ${{ runner.os }}-nix-store-${{ hashFiles('/nix/store/**') }}
37-
restore-keys: ${{ runner.os }}-nix-store-
38-
3915
- uses: cachix/install-nix-action@v16
4016
with:
4117
nix_path: nixpkgs=channel:nixos-21.11
4218
extra_nix_config: |
4319
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
4420
substituters = https://hydra.iohk.io https://cache.nixos.org/
21+
- uses: cachix/cachix-action@v10
22+
with:
23+
# https://nix.dev/tutorials/continuous-integration-github-actions#setting-up-github-actions
24+
# name: mycache ## TODO should this be set to name of Cachix account?
25+
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
26+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
4527
- run: nix-shell --pure --run "cabal update && cabal build all --enable-tests"

0 commit comments

Comments
 (0)