name: Example on: workflow_dispatch: jobs: eval: name: Evaluate flake runs-on: ubuntu-latest outputs: matrix: ${{ steps.generate.outputs.matrix }} steps: - uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@v9 - name: Generate matrix id: generate run: | set -eu echo "matrix=$(nix eval --show-trace --json .#workflowMatrix)" >> "$GITHUB_OUTPUT" build: needs: eval strategy: fail-fast: false matrix: ${{ fromJSON(needs.eval.outputs.matrix) }} name: Build (${{matrix.attr}}) runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Setup Qemu if: matrix.arch == 'aarch64' uses: docker/setup-qemu-action@v3 with: platforms: "arm64" - name: Install Nix if: matrix.arch != 'aarch64' uses: DeterminateSystems/nix-installer-action@v9 - name: Install Nix (with aarch64) if: matrix.arch == 'aarch64' uses: DeterminateSystems/nix-installer-action@v9 with: extra-conf: "extra-platforms = aarch64-linux arm-linux" - name: Build ${{ matrix.attr }} run: nix build -L .#${{ matrix.attr }}