Skip to content

Nix flake checks

Nix flake checks #15

Workflow file for this run

name: "Nix flake checks"
on:
pull_request:
push:
permissions:
contents: read
jobs:
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v27
- id: set-matrix
name: Generate Nix checks matrix
run: |
set -Eeu
matrix="$(nix eval --json '.#githubActions.matrix')"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
nix-build:
name: ${{ matrix.name }} (${{ matrix.system }})
needs: nix-matrix
runs-on: ${{ matrix.os }}
permissions:
actions: write
env:
CHECK_ATTR: ${{ matrix.attr }}
strategy:
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: nixbuild/nix-quick-install-action@25aff27c252e0c8cdda3264805f7b6bcd92c8718 # v29
- uses: nix-community/cache-nix-action@8351fb9f51c580c96c509987ebb99e38aed956ce # v5.2.1
with:
primary-key: build-${{ runner.os }}-${{ matrix.id }}-${{ hashFiles('.github/workflows/build-checks.yml', 'flake.lock') }}
purge: true
purge-last-accessed: 2629800 # 1 month
purge-primary-key: never
- run: nix build -L ".#${CHECK_ATTR}"