updates #350
  
    
      This file contains hidden or 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: "NixOS Rebuild" | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - darwin-*/** | |
| - nixos-tests/** | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| nixos-rebuild: | |
| strategy: | |
| matrix: | |
| host: | |
| - adama | |
| - starbuck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: nixbuild/nix-quick-install-action@v28 | |
| with: | |
| nix_conf: extra-platforms = aarch64-linux | |
| - uses: nix-community/cache-nix-action/restore@v5 | |
| with: | |
| primary-key: nix-nixos-${{ matrix.host }}-${{ hashFiles('**/*.nix') }} | |
| restore-prefixes-first-match: nix-nixos-${{ matrix.host }}- | |
| - uses: cachix/cachix-action@v15 | |
| with: | |
| name: esselius | |
| authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
| extraPullNames: nix-community | |
| - name: Evaluate nixos config | |
| id: drv-check | |
| run: | | |
| echo -n result= >> $GITHUB_OUTPUT | |
| nix --accept-flake-config path-info --derivation .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel | base64 -w 0 | tee /tmp/drv >> $GITHUB_OUTPUT | |
| - uses: nix-community/cache-nix-action/save@v5 | |
| if: github.ref == 'ref/head/main' | |
| with: | |
| primary-key: nix-nixos-${{ matrix.host }}-${{ hashFiles('**/*.nix') }} | |
| - uses: actions/cache@v4 | |
| id: cache-test | |
| with: | |
| path: /tmp/drv | |
| key: nixos-${{ hashFiles(format('{0}/{1}.{2}', 'nixos-configurations', matrix.host, 'nix')) }}-${{ steps.drv-check.outputs.result }} | |
| lookup-only: true | |
| - name: Get more disk space for build | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force | |
| sudo docker builder prune -a | |
| - name: Build nixos config | |
| if: steps.cache-test.outputs.cache-hit != 'true' | |
| run: nix --accept-flake-config build .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel |