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).
This commit is contained in:
alt-glitch 2026-07-22 21:04:55 +05:30
parent cbc1054e23
commit 10526c34ef
2 changed files with 59 additions and 0 deletions

42
.github/workflows/nix.yml vendored Normal file
View file

@ -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' }}"

17
scripts/nix-ci.sh Executable file
View file

@ -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