# SPDX-FileCopyrightText: 2025 Nitesh Kumar Debnath # # SPDX-License-Identifier: GPL-3.0-or-later name: "All nixos-machines checks" on: push: workflow_dispatch: # Least privilege by default; jobs that need OIDC for Tailscale opt in below. permissions: contents: read # A newer push to the same ref supersedes the older run, so pushes don't pile up # duplicate runs. Runs on the default branch are never cancelled midway. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch }} jobs: check_flake: name: "Run flake checks" runs-on: ubuntu-latest timeout-minutes: 120 environment: cachix permissions: contents: read id-token: write # OIDC token for the Tailscale GitHub Action steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up Nix uses: ./.github/actions/setup-nix # zizmor: ignore[self-repository] actionlint does not support `$/` yet with: ts-oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} ts-audience: ${{ secrets.TS_AUDIENCE }} cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Check flakes run: | nix flake check --keep-going \ --no-allow-import-from-derivation build_hosts: name: "Build packages for hosts" runs-on: ubuntu-latest timeout-minutes: 240 environment: cachix permissions: contents: read id-token: write # OIDC token for the Tailscale GitHub Action env: HOSTS: "tjmaxxer msi-colgate disko-elysium" steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: wimpysworld/nothing-but-nix@b2574ec1cf1462bee0a34de0fb6ff11ad3c43cb2 # v12 - name: Set up Nix uses: ./.github/actions/setup-nix # zizmor: ignore[self-repository] actionlint does not support `$/` yet with: ts-oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} ts-audience: ${{ secrets.TS_AUDIENCE }} cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Set up attic run: | nix profile add nixpkgs#attic-client attic login "elysium" "https://cache.curlew-rankine.ts.net" ${{ secrets.ATTIC_AUTH_TOKEN }} - name: Build machines run: | set -euo pipefail installables=() for host in $HOSTS; do installables+=(".#nixosConfigurations.${host}.config.system.build.toplevel") done nix build -j12 \ "${installables[@]}" attic push attic-1 -j 12 ./result*