-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 1.78 KB
/
nixos-rebuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: "NixOS Rebuild"
on:
pull_request:
paths-ignore:
- darwin-*/**
- nixos-tests/**
push:
branches:
- main
jobs:
nixos-rebuild:
strategy:
matrix:
host:
- adama
- cain
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: nixbuild/nix-quick-install-action@v28
with:
nix_conf: extra-platforms = aarch64-linux
- uses: nix-community/cache-nix-action/restore@v5
with:
primary-key: nix-nixos-${{ matrix.host }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-nixos-${{ matrix.host }}-
- uses: cachix/cachix-action@v15
with:
name: esselius
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: nix-community
- name: Evaluate nixos config
id: drv-check
run: |
echo -n result= >> $GITHUB_OUTPUT
nix --accept-flake-config path-info --derivation .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel | base64 -w 0 | tee /tmp/drv >> $GITHUB_OUTPUT
- uses: nix-community/cache-nix-action/save@v5
if: github.ref == 'ref/head/main'
with:
primary-key: nix-nixos-${{ matrix.host }}-${{ hashFiles('**/*.nix') }}
- uses: actions/cache@v4
id: cache-test
with:
path: /tmp/drv
key: nixos-${{ hashFiles(format('{0}/{1}.{2}', 'nixos-configurations', matrix.host, 'nix')) }}-${{ steps.drv-check.outputs.result }}
lookup-only: true
- name: Build nixos config
if: steps.cache-test.outputs.cache-hit != 'true'
run: nix --accept-flake-config build .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel