Skip to content

Commit 49f09ed

Browse files
committed
attempt to cache /nix in Nix Shell Github Action
cachix/install-nix-action#56 (comment)
1 parent 5a5b310 commit 49f09ed

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.github/workflows/nix-shell.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,29 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- 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: |
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('**') }}
37+
restore-keys: ${{ runner.os }}-nix-store-
38+
1639
- uses: cachix/install-nix-action@v16
1740
with:
1841
nix_path: nixpkgs=channel:nixos-21.11

0 commit comments

Comments
 (0)