maybe it it wonna work this way? #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nix Flake actions | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
jobs: | ||
free-disk-space: | ||
runs-on: ubuntu-latest | ||
steps: | ||
nix-matrix: | ||
needs: free-disk-space | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v27 | ||
- id: set-matrix | ||
name: Generate Nix Matrix | ||
run: | | ||
set -Eeu | ||
matrix="$(nix eval --json '.#githubActions.matrix')" | ||
echo "matrix=$matrix" >> "$GITHUB_OUTPUT" | ||
# nix-build: | ||
# needs: nix-matrix | ||
# runs-on: ${{ matrix.os }} | ||
# strategy: | ||
# matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}} | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: cachix/install-nix-action@v27 | ||
# - uses: cachix/cachix-action@v15 | ||
# with: | ||
# name: mur | ||
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
# - name: Build "${{ matrix.attr }}" | ||
# run: nix build -L ".#${{ matrix.attr }}" | ||
nix-build-stable: | ||
needs: nix-matrix | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}} | ||
steps: | ||
- uses: jlumbroso/free-disk-space@main | ||
with: | ||
# this might remove tools that are actually needed, | ||
# if set to "true" but frees about 6 GB | ||
tool-cache: true | ||
# all of these default to true, but feel free to set to | ||
# "false" if necessary for your workflow | ||
swap-storage: true | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v27 | ||
- uses: cachix/cachix-action@v15 | ||
with: | ||
name: mur | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
- name: Build "${{ matrix.attr }}" | ||
run: nix build --inputs-from . --override-input nixpkgs stable -L ".#${{ matrix.attr }}" |