Skip to content

Commit 04735fa

Browse files
committed
export the whole nix store
1 parent b25d535 commit 04735fa

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/maven.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: cachix/install-nix-action@v31
21+
- name: List pre-installed store paths
22+
run: find /nix/store -mindepth 1 -maxdepth 1 | sort > pre-installed
2123
- uses: actions/cache/restore@v4
2224
id: cache
2325
with:
@@ -28,11 +30,15 @@ jobs:
2830
if: steps.cache.outputs.cache-hit == 'true'
2931
run: |
3032
nix-store --import < cache-closure.nar
31-
- name: Build and export cache
33+
- name: Build cache
3234
if: steps.cache.outputs.cache-hit != 'true'
3335
run: |
3436
nix-build --out-link dependencies nix/github-workflow-dependencies.nix
35-
nix-store --export $(nix-store --query --requisites dependencies) > cache-closure.nar
37+
- name: Export cache
38+
if: steps.cache.outputs.cache-hit != 'true'
39+
run: |
40+
find /nix/store -mindepth 1 -maxdepth 1 | sort > store-paths
41+
nix-store --export $(comm -13 pre-installed store-paths) > cache-closure.nar
3642
- uses: actions/cache/save@v4
3743
if: steps.cache.outputs.cache-hit != 'true'
3844
with:

0 commit comments

Comments
 (0)