Skip to content

chore(deps): lock file maintenance #407

chore(deps): lock file maintenance

chore(deps): lock file maintenance #407

name: Nix Flake actions
on:
pull_request:
push:
branches:
- master
- main
jobs:
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: cachix/install-nix-action@17fe5fb4a23ad6cbbe47d6b3f359611ad276644c # v31
- id: set-matrix
name: Generate Nix Matrix
run: |
set -euo pipefail
matrix="$(nix eval --json '.#githubActions.matrix')"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
echo "$matrix" | jq
nix-build:
needs: nix-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # let it build all the targets
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: cachix/install-nix-action@17fe5fb4a23ad6cbbe47d6b3f359611ad276644c # v31
with:
extra_nix_config: |
auto-optimise-store = true
system-features = nixos-test benchmark big-parallel kvm
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
experimental-features = nix-command flakes
- uses: nix-community/cache-nix-action@135667ec418502fa5a3598af6fb9eb733888ce6a # v6
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size-linux: 1073741824
purge: true
purge-prefixes: nix-${{ runner.os }}-
purge-created: 0
purge-primary-key: never
- uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad # v16
with:
name: snowflake
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: nixbuild/nixbuild-action@4d83d2224e2b8a6eb6ddfd1b2525b1533d3f8bd1 # v20
with:
nixbuild_token: ${{ secrets.NIXBUILD_AUTH_TOKEN }}
generate_summary_for: 'workflow'
- run: |
nix build \
--print-build-logs \
--builders "" \
--max-jobs 2 \
--eval-store auto \
--store ssh-ng://eu.nixbuild.net \
".#githubActions.checks.${{ matrix.attr }}"