From 10526c34ef33957e3f0b5d4fd18d5e5b3d3bf3af Mon Sep 17 00:00:00 2001 From: alt-glitch Date: Wed, 22 Jul 2026 21:04:55 +0530 Subject: [PATCH] ci(nix): restore nix CI as trigger-only workflow with local entrypoint Re-adds nix CI (removed in 9eb0bcd60) in minimal form: runs only on workflow_dispatch or the ci/nix PR label, never on push/PR by default. Both CI and local devs run the same scripts/nix-ci.sh (check|build). The old stale-npmDepsHash machinery (fix-lockfiles, sticky comments, auto-fix job) is intentionally not restored: importNpmLock (#48883) removed npmDepsHash entirely, so that failure class no longer exists. Reuses the still-present .github/actions/nix-setup composite (Cachix). --- .github/workflows/nix.yml | 42 +++++++++++++++++++++++++++++++++++++++ scripts/nix-ci.sh | 17 ++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/nix.yml create mode 100755 scripts/nix-ci.sh diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 00000000000..57625d46981 --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,42 @@ +name: Nix + +on: + workflow_dispatch: + inputs: + job: + description: Nix job to run + type: choice + options: + - check + - build + default: check + pull_request: + types: [labeled] + +permissions: + contents: read + +concurrency: + group: nix-${{ github.ref }} + cancel-in-progress: true + +jobs: + nix: + if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'ci/nix' + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + timeout-minutes: 45 + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Set up Nix + uses: ./.github/actions/nix-setup + with: + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - name: Run Nix job + run: scripts/nix-ci.sh "${{ github.event.inputs.job || 'check' }}" diff --git a/scripts/nix-ci.sh b/scripts/nix-ci.sh new file mode 100755 index 00000000000..e4ac7b56dbb --- /dev/null +++ b/scripts/nix-ci.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -euo pipefail + +case "${1:-check}" in + check) + nix flake check --print-build-logs + ;; + build) + nix build .#default .#tui .#web .#desktop \ + --no-link --print-build-logs + ;; + *) + echo "Usage: $0 [check|build]" >&2 + exit 2 + ;; +esac