dotfiles

My PC Dotfiles & Website

.github/workflows/build.yml (1786B)


 1name: "ci: Build `nixosConfigurations`"
 2on:
 3  workflow_dispatch:
 4  workflow_call:
 5  push:
 6    tags:
 7      - "*"
 8    paths:
 9      - "**.lock"
10  pull_request:
11    types: [opened, synchronize, reopened, ready_for_review]
12    paths:
13      - "**.lock"
14      - "**.nix"
15env:
16  NIX_SHOW_STATS: 1
17jobs:
18  build:
19    if: github.event.pull_request.draft == false
20    runs-on: ubuntu-latest
21    steps:
22      - name: Maximize Build Space
23        run: |
24          sudo rm -rf /usr/share/dotnet
25          sudo rm -rf /opt/ghc
26          sudo rm -rf "/usr/local/share/boost"
27          sudo rm -rf "$AGENT_TOOLSDIRECTORY"
28      - name: Clone Repo
29        uses: actions/checkout@v7
30        with:
31          token: ${{ secrets.GITHUB_TOKEN }}
32          fetch-depth: 0
33      - name: Install Nix
34        uses: cachix/install-nix-action@v31
35        with:
36          extra_nix_config: |
37            experimental-features = nix-command flakes
38            accept-flake-config = true
39            access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
40      - name: Setup Cachix
41        uses: cachix/cachix-action@v17
42        with:
43          name: maydayv7-dotfiles
44          authToken: "${{ secrets.CACHIX_TOKEN }}"
45      - name: Build Configurations
46        run: |
47          export LC_ALL=C.UTF-8
48          ulimit -n 2048
49
50          hosts="$(nix eval --raw '.#nixosConfigurations' \
51            --apply 'c: builtins.concatStringsSep " " (builtins.filter (h: h != "install") (builtins.attrNames c))')"
52
53          status=0
54          for host in ${hosts}
55          do
56            echo "::group::Building '${host}'"
57            nix build ".#nixosConfigurations.${host}.config.system.build.toplevel" \
58              -L --show-trace || status=1
59            echo "::endgroup::"
60          done
61          exit "${status}"