home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

commit ef5df9e7181481ba32969eac518da5d483d42d9e
parent 79ad4c906e8bab5e0eb8d2bac23a4d381152fa26
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Mon, 27 Nov 2023 19:46:04 +0100

Trying out a github workflow

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
A.github/workflows/build-systems.yaml | 48++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+), 0 deletions(-)

diff --git a/.github/workflows/build-systems.yaml b/.github/workflows/build-systems.yaml @@ -0,0 +1,48 @@ +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@v4 + - uses: cachix/install-nix-action@v23 + - id: set-matrix + name: Generate Nix Matrix + run: | + set -Eeu + nix flake show --json | jq '.nixosConfigurations | to_entries | map({"name": .key})' + echo matrix="{\"include\": " $(nix flake show --json | jq '.nixosConfigurations | to_entries | map({"name": .key})') >> "$GITHUB_OUTPUT" "}" + cat $GITHUB_OUTPUT + + nix-build: + needs: nix-matrix + runs-on: ubuntu-latest + strategy: + fail-fast: false # Keep running if one leg fails. + matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}} + steps: + - name: Maximize build space + uses: AdityaGarg8/remove-unwanted-software@v1 + with: + remove-android: 'true' + remove-dotnet: 'true' + - name: Build + run: | + echo "Free space:" + df -h + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v23 + - uses: cachix/cachix-action@v12 + with: + name: chapeau-rouge + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build -L ".#nixosConfigurations.${{ matrix.name }}.config.system.build.toplevel"