auto-update-daily-20260202
 1name: systems
 2
 3permissions:
 4  contents: read
 5
 6on:
 7  workflow_dispatch: {}
 8  pull_request:
 9    paths:
10      - 'home/**'
11      - 'systems/**'
12      - 'lib/**'
13      - 'modules/**'
14      - 'tools/battery-monitor/**'
15      - 'tools/bekind/**'
16      - 'tools/go-org-readwise/**'
17      - 'tools/k8s.infra/**'
18      - 'flake.nix'
19      - 'flake.lock'
20      - '.github/workflows/build-systems.yaml'
21  push:
22    branches:
23      - main
24    paths:
25      - 'home/**'
26      - 'systems/**'
27      - 'lib/**'
28      - 'modules/**'
29      - 'tools/battery-monitor/**'
30      - 'tools/bekind/**'
31      - 'tools/go-org-readwise/**'
32      - 'tools/k8s.infra/**'
33      - 'flake.nix'
34      - 'flake.lock'
35      - '.github/workflows/build-systems.yaml'
36
37concurrency:
38  group: ${{ github.workflow }}-${{ github.ref }}-systems
39  cancel-in-progress: true
40
41jobs:
42  nix-matrix:
43    runs-on: ubuntu-latest
44    outputs:
45      matrix: ${{ steps.set-matrix.outputs.matrix }}
46    steps:
47      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
48      - uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
49      - id: set-matrix
50        name: Generate Nix Matrix
51        run: |
52          set -Eeu
53          set -o pipefail
54          echo "matrix={\"include\": $(nix eval .#githubActionsMatrix --raw)}" >> "$GITHUB_OUTPUT"
55          cat $GITHUB_OUTPUT
56
57  nix-build:
58    needs: nix-matrix
59    runs-on: ${{ matrix.arch == 'aarch64-linux' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
60    strategy:
61      fail-fast: false # Keep running if one leg fails.
62      matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
63    steps:
64      - name: Maximize build space
65        uses: AdityaGarg8/remove-unwanted-software@90e01b21170618765a73370fcc3abbd1684a7793 # v5
66        with:
67          remove-android: 'true'
68          remove-dotnet: 'true'
69          remove-haskell: 'true'
70          remove-codeql: 'true'
71          remove-docker-images: 'false'
72          remove-large-packages: 'true'
73          remove-cached-tools: 'true'
74          remove-swapfile: 'true'
75      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
76      - uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
77      - uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad # v16
78        with:
79          name: vdemeester
80          authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
81          skipPush: ${{ github.event_name == 'pull_request' }}
82      - name: build
83        run: |
84          # FIXME temporary hack to make system build successfully
85          #       I need to create dumb file for mkOutOfStoreSymlink
86          sudo mkdir -p /home/vincent/src/home/dots/.config/emacs /home/vincent/desktop/documents
87          sudo touch /home/vincent/desktop/documents/.oath
88          # build the system
89          nix build --accept-flake-config -L ".#nixosConfigurations.${{ matrix.name }}.config.system.build.toplevel"