Skip to content

Commit a8f1b5d

Browse files
authored
feat(ci): nix caching (#64)
1 parent d3b9f82 commit a8f1b5d

File tree

6 files changed

+39
-10
lines changed

6 files changed

+39
-10
lines changed

.github/workflows/build-vms-manual.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ jobs:
3333
- uses: actions/checkout@v4
3434

3535
- name: Install Nix
36-
uses: DeterminateSystems/nix-installer-action@main
36+
uses: nixbuild/nix-quick-install-action@v34
3737

38+
- name: Setup Nix cache
39+
uses: nix-community/cache-nix-action@v6
40+
with:
41+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
42+
restore-keys: |
43+
nix-${{ runner.os }}-
3844
- name: Set up Cachix (feltnerm)
3945
uses: cachix/cachix-action@v15
4046
with:

.github/workflows/ci.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
steps:
1212
- uses: actions/checkout@v4
13-
- uses: DeterminateSystems/nix-installer-action@main
13+
- uses: nixbuild/nix-quick-install-action@v34
14+
- uses: nix-community/cache-nix-action@v6
15+
with:
16+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
17+
restore-keys: |
18+
nix-${{ runner.os }}-
1419
- name: flake info
15-
run: nix flake info
20+
run: nix flake info --show-trace
1621
- name: show flake
17-
run: nix flake show
22+
run: nix flake show --show-trace
1823
- name: format
1924
run: nix fmt
2025
- name: flake check (all systems)
21-
run: nix flake check --all-systems
26+
run: nix flake check --all-systems --show-trace
2227
- name: example flake check (minimal)
2328
run: |
2429
cd tests/example-flake

.github/workflows/gh-pages.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ jobs:
1919
- uses: actions/checkout@v4
2020

2121
- name: Install Nix
22-
uses: DeterminateSystems/nix-installer-action@main
22+
uses: nixbuild/nix-quick-install-action@v34
2323

24-
- name: Enable binary cache
25-
uses: DeterminateSystems/magic-nix-cache-action@main
24+
- name: Setup Nix cache
25+
uses: nix-community/cache-nix-action@v6
26+
with:
27+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
28+
restore-keys: |
29+
nix-${{ runner.os }}-
2630
2731
- name: Build and prepare site content
2832
run: |

.github/workflows/update-flake-lock.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12-
- uses: DeterminateSystems/nix-installer-action@main
12+
- uses: nixbuild/nix-quick-install-action@v34
1313
- uses: DeterminateSystems/update-flake-lock@v21
1414
with:
1515
token: ${{ secrets.GH_TOKEN_FLAKE_UPDATES }}
@@ -21,3 +21,8 @@ jobs:
2121
git-author-email: 'github-actions[bot]@users.noreply.github.com'
2222
git-committer-name: 'feltnerm-action-bot'
2323
git-committer-email: 'github-actions[bot]@users.noreply.github.com'
24+
- uses: nix-community/cache-nix-action@v6
25+
with:
26+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
27+
restore-keys: |
28+
nix-${{ runner.os }}-

.github/workflows/vm-build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@ jobs:
2626
- uses: actions/checkout@v4
2727

2828
- name: Install Nix
29-
uses: DeterminateSystems/nix-installer-action@main
29+
uses: nixbuild/nix-quick-install-action@v34
3030

31+
- name: Setup Nix cache
32+
uses: nix-community/cache-nix-action@v6
33+
with:
34+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
35+
restore-keys: |
36+
nix-${{ runner.os }}-
3137
- name: Set up Cachix (feltnerm)
3238
uses: cachix/cachix-action@v15
3339
with:

tests/example-flake/hosts/test-nixos/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@
99

1010
# Very basic network settings
1111
networking.hostName = lib.mkDefault "test-minimal";
12+
13+
# Avoid building man cache in CI to stabilize builds
14+
documentation.man.generateCaches = false;
1215
}

0 commit comments

Comments
 (0)