Integrates nix flake checks into CI/CD pipelines using nix-eval-jobs, nix-fast-build, and buildbot-nix. Covers migration from hand-crafted CI matrices, binary cache strategy, and effect execution models.
Ships in preferences-nix-and-secrets. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill covers the integration of nix flake checks into continuous integration and continuous delivery pipelines.
The companion skill preferences-nix-checks-architecture covers what to build (check taxonomy, derivation patterns, source filtering).
This skill covers where and how to run those checks: the tools, the migration path, the effect execution model, and the caching strategy.
The content is organized around the lifecycle of a CI pipeline for a nix-based repository. The nix-native CI principle establishes the architectural foundation. nix-eval-jobs and nix-fast-build provide the execution machinery. buildbot-nix provides the self-hosted runner. The two-phase migration pattern provides the transition path from existing CI to the nix-native model. The effect execution strategies cover continuous delivery. The binary cache strategy covers build artifact management. Pipeline observability covers operational visibility. The merge-confidence feedback loop covers how those signals are read to decide that a pull request is safe to land.
The foundational insight is that nix flake check defines the entire validation surface of a repository as a set of pure derivations.
Once checks are expressed as flake attributes, the question of where they run becomes a deployment-time decision independent of the check definitions themselves.
The same checks run under nix flake check on a developer's laptop, under nix-fast-build in a GitHub Actions workflow, and under buildbot-nix on a self-hosted server.
No check logic lives in CI workflow YAML.
No build matrix duplicates what the flake already declares.
The CI runner is a thin shell that invokes nix tooling against the flake's check surface.
This decoupling means runner selection (GitHub Actions, buildbot-nix, Hercules CI, Garnix) does not affect check design. A repository can migrate from one runner to another without modifying any nix code. The migration affects only the CI configuration layer, not the validation layer.
The principle has a corollary for local development: if a check passes under nix flake check on the developer's machine, it will pass in CI.
There is no "works on my machine" gap because the check derivation is hermetic.
The only variable is the builder's system architecture (a checks.aarch64-darwin derivation cannot build on an x86_64-linux worker), which is a deployment constraint, not a design decision.
The anti-pattern this principle replaces is CI workflows that embed build logic in YAML: matrix strategies that enumerate packages, conditional steps that select which checks to run, and shell scripts that partition the flake output space into categories for parallel dispatch. All of that logic already exists in the flake's attribute structure and should be consumed, not reimplemented, by the CI system. When build logic lives in YAML, changes to the flake's output structure (adding a new check, renaming a package) require corresponding changes to the CI workflow. When the CI runner simply evaluates the flake, new checks are picked up automatically on the next push.
nix-eval-jobs is the evaluation engine that makes parallel CI execution possible.
Standard nix flake check evaluates the flake and builds every check derivation sequentially in a single process.
nix-eval-jobs replaces this with parallel evaluation: multiple worker processes evaluate flake outputs concurrently and produce a stream of derivation metadata (store path, system, attribute path, derivation hash) as JSON objects on stdout.
Each output can be independently scheduled for building, which decouples evaluation from building and enables per-derivation parallelism.
The JSON stream format is designed for machine consumption.
Each line is a self-contained JSON object describing one derivation, including its attribute path (e.g., checks.x86_64-linux.clippy), store path, and whether it is cached.
Downstream tools consume this stream to make scheduling decisions without re-evaluating the flake.
nix-fast-build wraps nix-eval-jobs for cache-aware distributed building.
It evaluates the flake, checks each derivation against configured binary caches, builds only what is missing, and optionally pushes results to a cache.
The tool handles failure isolation: when one derivation fails to build, other derivations continue building, and the exit code reflects the aggregate result.
This is a substantial improvement over nix flake check, which aborts on the first failure.
The key flags for CI integration:
--eval-workers N and --eval-max-memory-size MiB together set the evaluator's parallelism and its memory budget. They are sized jointly by measurement on the host that runs them, as described below.--niks3-server URL uploads built paths to a self-hosted niks3 cache. Cache lookups use nix's substituters configuration, which is separate.--result-format junit produces JUnit XML output that CI platforms parse for per-check reporting in their dashboards.--skip-cached avoids rebuilding derivations that already exist in the configured binary cache.--no-nom forces the non-interactive per-build log renderer even on a terminal. The name is historical: since 2.0 nix-fast-build renders build logs itself and no longer uses nix output monitor (nom). The interactive renderer already disables itself when stderr or stdin is not a TTY, so CI log capture does not require the flag; passing it is explicit rather than necessary.The --eval-workers flag deserves elaboration because both its rationale and its value are commonly copied from elsewhere, and neither transfers between hosts.
nix-eval-jobs evaluates flake outputs by forking worker processes, each of which accesses the nix eval cache (a SQLite database).
Under high parallelism, SQLite write locks can cause contention that manifests as "database is locked" errors or evaluation timeouts, and that is one reason to bound the worker count.
It is not the constraint that governs sizing on a memory-bound CI host.
The constraint that does govern it is memory.
Stock nix-eval-jobs documents in its README that workers x max-memory-size is a single shared memory budget for the whole evaluation.
A worker whose heap exceeds its share is not killed mid-attribute; it finishes the attribute in flight, exits, and is replaced by a fresh worker before the next attribute.
Stock nix-eval-jobs runs the Boehm collector with GC_DONT_GC=1, so a worker's heap only grows until it is recycled.
Sizing is therefore a tradeoff between parallelism and restart frequency: more workers each get a smaller share and recycle more often.
The price of a restart is whatever fixed work a fresh worker must redo before it can evaluate its first attribute, which is at minimum the strict key set of the attribute set it is reaching into (see §"Key-set strictness" under §"Evaluation cost as a design constraint" in preferences-nix-checks-architecture).
In this repository a check module once derived its key set from six evaluated NixOS machine configurations, so every fresh worker paid ~930 MiB and ~3 s before evaluating anything, and that cost was paid ~26 times per run; after the fix a trivial check costs 89 MiB and 0.27 s.
Restart frequency is only cheap when that fixed cost is small, so the worker sizing and the flake's evaluation structure have to be read together.
The measured sizing of stock nix-eval-jobs for this fleet's CI host (magnetite, 16 vCPU, 30.6 GiB RAM) over a 311-attribute, two-system scope (x86_64-linux and aarch64-darwin) is recorded in modules/nixos/nixbot.nix:
| workers x max-memory-size | wall time | restarts |
|---|---|---|
| 6 x 3072 MiB | 341 s | 24 |
| 5 x 4096 MiB | 419 s | 20 |
| 4 x 4096 MiB | 476 s | 16 |
| 8 x 2048 MiB | 505 s | 42 |
6 x 3072 MiB was chosen.
More parallelism won there because most attributes are small, so a worker evaluates many of them between restarts and the extra workers convert directly into throughput.
Pushing to 8 workers shrank each share to 2048 MiB, which nearly doubled the restarts and lost more to repeated fixed work than the extra workers gained.
A different host, a different attribute scope, or a flake with a heavier per-worker fixed cost would put the optimum elsewhere, which is why the table is evidence for a method rather than a constant to copy.
The pyrite laptop, with 15.5 GiB, runs --eval-workers 2 --eval-max-memory-size 2048 for the same reason (see nix-flake-pr-cycle).
The method is to measure on the actual host rather than adopt a default: run the real attribute scope under a few candidate workers x max-memory-size products, record wall time, peak memory, and restart count, and choose the fastest configuration whose peak leaves headroom for concurrent builds.
Any evaluation run on a production host must also keep a hard memory bound, both through the nix-eval-jobs budget and through the service's cgroup limits.
The hazard is not hypothetical: an unbounded evaluation probe on this fleet's CI host exhausted memory and hard-reset the machine via the kernel watchdog.
The host-wide evaluation lock that serializes remote nix-eval-jobs runs against nixbot's own evaluation exists for the same reason.
Stock is not the only evaluator that answers to nix-eval-jobs.
iets, an independent Nix evaluator, implements the same command line and can be installed under that name; on the check sets it has been measured against, it evaluated several times faster than stock.
It does not share stock's memory model, so a sizing measured for one evaluator does not carry over to the other:
--max-memory-size only where it can read a worker's peak resident memory, which is Linux; on macOS the flag does nothing and only the worker count bounds memory.--override-input, --override-flake, --repair and --help, and evaluates only a local root flake.Where it is installed, keep stock beside it under a second name as the escape hatch for what it refuses, and gate the substitution with the drvPath-identity oracle between the two evaluators (preferences-nix-checks-architecture, references/evaluation-cost.md), re-run on every version bump.
Before sizing or comparing, establish which evaluator a host's nix-eval-jobs actually is, since a wrapper may also cap the workers a caller asks for.
Two execution modes serve different contexts in the justfile convention.
just check runs sequential nix flake check, which is appropriate for local development where the developer watches output interactively and benefits from nom's progress display.
The sequential mode also provides simpler error output: when a single check fails, the error is immediately visible without interleaving from parallel builds.
just check-fast runs parallel nix-fast-build with failure isolation and JUnit output, which is appropriate for CI where parallelism, structured reporting, and total wall time matter more than interactive display.
Both modes validate the same set of derivations; the difference is execution strategy, not validation scope.
The universal structural anti-pattern that nix-fast-build replaces deserves explicit description because it appears in many nix CI configurations developed before nix-fast-build existed.
A flake-validation GitHub Actions job runs nix flake check, which builds all checks sequentially in a single derivation graph.
Then a separate nix matrix job uses a ci-build-category.sh script to partition flake outputs into categories (packages, checks, devshells, home configurations, NixOS configurations) and rebuilds the same checks individually for per-category visibility.
The motivation for the matrix job is reasonable: per-category build status provides better failure isolation than a monolithic nix flake check that reports only "something failed."
But the implementation duplicates all builds.
nix-fast-build eliminates this duplication entirely: it evaluates once, builds in parallel with per-attribute failure isolation, and reports per-attribute results in JUnit format that CI dashboards render natively.
The transition from the categorized pattern to nix-fast-build also eliminates a maintenance burden.
The ci-build-category.sh script must be updated whenever the flake's output structure changes (new check categories, renamed packages, new machine configurations).
nix-fast-build discovers the output structure dynamically from the flake, so structural changes require no CI workflow updates.
buildbot-nix is a NixOS module that runs a Buildbot instance configured specifically for nix flake evaluation and building. It discovers repositories via forge integration (GitHub, Gitea, or both in dual-forge mode) and evaluates their flake outputs on push and pull request events.
buildbot-nix.toml is the per-repo configuration file that lives in the repository root.
The attribute field scopes which flake outputs nix-eval-jobs evaluates.
It defaults to "checks", which restricts nix-eval-jobs to the checks flake output.
Setting attribute = "checks.x86_64-linux" further restricts evaluation to linux checks, avoiding cross-system eval failures on repos that define outputs for systems the buildbot workers cannot build.
To evaluate additional outputs like packages, set attribute explicitly (e.g. a custom path covering the desired output tree).
Project registration uses the build-with-buildbot GitHub topic (or Gitea topic) as the discovery mechanism.
Adding this topic to a repository causes buildbot-nix to pick it up on its next scan and begin evaluating pushes.
No manual registration or API call is required.
Removing the topic deregisters the project.
This topic-based discovery allows repository owners to opt in and opt out of buildbot-nix CI without requiring access to the buildbot server configuration.
In dual-forge mode, buildbot-nix monitors both a GitHub organization and a Gitea instance simultaneously.
A repository can exist on both forges (mirrored) or exclusively on one.
The herculesCI context provides repository metadata (branch, ref, tag, rev, remoteHttpUrl) that effects can use for forge-specific behavior (e.g., posting status to GitHub but not Gitea, or vice versa).
The dual-scheduler architecture separates evaluation from building, which is one of buildbot-nix's most practically important design decisions.
The first scheduler runs nix-eval-jobs to evaluate the flake.
On evaluation success, it triggers per-attribute build schedulers.
This separation produces distinct status checks: buildbot/nix-eval reports whether the flake evaluates cleanly, and buildbot/nix-build reports individual build results.
Evaluation failures (syntax errors, infinite recursion, missing inputs) are immediately visible without waiting for builds.
The practical consequence is faster feedback on common errors. A typo in a nix expression, a missing input, or an infinite recursion in module evaluation are all caught during the evaluation phase, which typically completes in seconds. Without the dual-scheduler separation, these errors would only surface after the build scheduler attempts (and fails) to build the derivation, which can take minutes to reach depending on scheduling latency.
fullyPrivate mode adds oauth2-proxy in front of the buildbot web UI, requiring OAuth2 authentication for all web access.
It forces authBackend to httpbasicauth, which makes github.enable default to false.
To retain GitHub commit status posting under fullyPrivate, set github.enable = true explicitly.
Mergify or similar merge automation gates on the buildbot status checks.
The typical configuration requires both buildbot/nix-eval and buildbot/nix-build to succeed, along with any remaining GitHub Actions checks (fast-forward verification, bootstrap checks) before allowing a merge.
This gating ensures that no PR merges with broken nix evaluation or failing builds, regardless of which runner performs the validation.
Logs for a buildbot build referenced from a PR check row are retrieved via the buildbot-logs shell application defined in this repository at modules/home/tools/commands/_dev-tools.nix.
It takes the builder id and build number parsed from the buildbot URL (/#/builders/<builder_id>/builds/<build_number>), connects over ssh to the buildbot master (default magnetite.zt, override with BUILDBOT_SSH_HOST), and concatenates every non-hidden step's logs to stdout:
buildbot-logs <builder_id> <build_number> > "logs/buildbot-<builder_id>-<build_number>.log"
Set BUILDBOT_INCLUDE_HIDDEN=1 to include steps marked hidden.
Authentication uses the buildbot http basic auth password read from sops-decrypted secrets on the master, so the invoking user must have ssh access to the buildbot host and non-interactive sudo privileges to read that secret.
See the "Unified PR check log retrieval" section in the ci-log-verification skill for the cross-backend entry point (gh pr checks <N>) that produces the builder/build inputs alongside GitHub Actions run ids.
Cross-reference references/buildbot-nix-configuration.md for the full buildbot-nix.toml schema, GitHub App permissions, worker configuration, and effect pipeline details.
Migrating a repository from hand-crafted CI workflows to nix-native CI proceeds in two phases. The phases are designed so that each one independently delivers value and the repository remains fully functional between them.
Phase 1 replaces categorized CI dispatch with nix-fast-build while still running on GitHub Actions.
The transformation has three steps: refactor all validation logic into nix flake check attributes (if not already there), replace the ci-build-category.sh matrix dispatch with a single nix-fast-build invocation, and archive deprecated CI artifacts to .github/deprecated/.
After phase 1, GitHub Actions is a thin shell invoking nix-fast-build, and checks run identically under nix flake check locally and under nix-fast-build in CI.
The deliverable is runner-agnostic validation: the nix layer is complete, and the CI layer is minimal.
Phase 1 is independently valuable even if phase 2 never happens. The repository benefits from simplified CI maintenance, per-check failure isolation, JUnit reporting, and the elimination of duplicated builds. Projects that do not have access to a self-hosted buildbot-nix instance can remain in phase 1 indefinitely.
Phase 2 delegates nix check execution to a self-hosted buildbot-nix instance.
The repository adds a buildbot-nix.toml configuration, registers as a buildbot project via the build-with-buildbot topic, and configures merge gating on buildbot status checks.
GitHub Actions nix-check jobs are either converted to passthrough (forwarding to buildbot results) or removed entirely.
Only CD workflows (deploy, release, publish) and platform-specific checks remain in GitHub Actions.
The readiness gate for phase 2 is that the repository must be registered as a buildbot-nix project, confirmed by its appearance in the buildbot project list and successful evaluation of a test push. Phase 2 adds value beyond phase 1 in three ways: it moves nix builds off GitHub-hosted runners (which have limited nix store persistence and time limits), it provides a persistent binary cache warm from prior builds (the buildbot worker's nix store is persistent), and it enables nix-native effects (which require the buildbot-nix effect runner).
The boundary between phase 1 and phase 2 is a natural checkpoint for validating the migration. Before proceeding to phase 2, verify that the phase 1 CI runs produce identical validation results to the pre-migration CI. Any discrepancy indicates a check that was present in the categorized dispatch but missing from the flake's check attributes, or a check that was redundantly defined in both places. Resolving these discrepancies during phase 1 ensures that phase 2 delegates a complete and correct check surface.
Cross-reference references/migration-pattern.md for the detailed recipe including canonical commits from the ironstar migration and per-repo variation guidance.
Effects are operations with side effects: deploying services, publishing artifacts, sending notifications, updating lock files, running scheduled maintenance. Two strategies exist for executing effects, and the choice depends on where the effect's target lives and whether the "verify even when gated off" property adds value. Before adding an effect, a CI step or a local pre-flight script, name the fact it establishes that evaluation, a build or an existing check does not, and whether its impure input could instead be a derivation input; if there is no such fact, do not add it.
Platform-native effects execute as CI workflow steps (GitHub Actions steps, Gitea Actions steps) that invoke nix-built tools.
The typical pattern is a writeShellApplication derivation exposed as a flake app, called via nix run .#deploy-thing in a workflow step.
Secrets are managed by the CI platform (GitHub repository secrets, Gitea secrets) and injected as environment variables.
The nix derivation provides hermetic tooling (the deploy script is built with all its dependencies in the nix store), but the orchestration (when to run, with what secrets, on what trigger) lives in the CI platform.
This strategy is appropriate when the CI platform is the target of the effect (GitHub releases, GitHub Pages deployment via gh-pages, marketplace publishing) or for simple effects where the hercules-ci interface adds no value over a shell script.
Effect logic lives in workflow YAML, which makes it visible to developers familiar with the CI platform but couples the effect to a specific runner.
Migrating a platform-native effect from GitHub Actions to Gitea Actions requires rewriting the workflow YAML, though the underlying nix app remains unchanged.
Nix-native effects are defined as derivations with isEffect = true in a herculesCI or effects flake output.
buildbot-nix discovers effects after all checks pass, following a sequential pipeline: evaluate the flake, build all checks, discover effects, run effects.
Effects execute in a bubblewrap sandbox with network access and nix daemon access, mimicking the hercules-ci-agent execution environment.
The sequential ordering is deliberate: effects should not run if checks fail, because a deployment of broken code is worse than no deployment.
The runIf gating pattern is the key design feature that distinguishes nix-native effects from platform-native effects.
runIf condition effect behaves as follows: when the condition is true, the effect executes normally.
When the condition is false, the effect's inputDerivation is still exposed with isEffect = false and buildDependenciesOnly = true.
This means all build dependencies of the effect are built and cached, verifying that the deployment would succeed, without actually executing the side-effecting operation.
A deployment gated on branch == "main" still has its closure built on every pull request, catching build failures before merge.
This property is not achievable with platform-native effects, where the deployment either runs or does not, with no intermediate "build but do not execute" state.
The onSchedule interface enables recurring effects.
A flakeUpdate effect scheduled via onSchedule with when = { hour = [ 4 ]; dayOfWeek = [ "Mon" ]; } produces a Buildbot Nightly scheduler that evaluates the flake on the specified schedule, builds any effects, and runs them.
Changing the schedule in the flake and pushing to the default branch triggers a buildbot reconfig that updates the Nightly scheduler's timing without manual intervention.
Nix-native effects are appropriate for system deployments (runNixOS, runNixDarwin over SSH), scheduled operations (flake.lock updates, cache garbage collection), and any effect whose build dependencies benefit from the "verify even when gated off" property.
Cross-reference references/nix-native-effects.md for the mkEffect and modularEffect APIs, bubblewrap execution details, secret injection patterns, common effect types, the herculesCI flake output interface, flake-parts integration, and local testing.
Use nix-native effects when the build dependencies are substantial and verifying them on every PR catches real failures.
NixOS deployments, Darwin deployments, and any operation that builds a system closure are strong candidates.
The system closure for a NixOS configuration is typically hundreds of megabytes and takes minutes to build.
Discovering that it fails to build after merging to main is substantially more disruptive than discovering it on the PR.
The runIf pattern provides this pre-merge verification automatically.
Scheduled operations that should produce buildbot-visible results (flake.lock update PRs, cache GC reports) also benefit from the nix-native model.
The onSchedule interface provides cron-like timing with full buildbot visibility: each scheduled run appears in the buildbot UI with build logs, status, and duration.
Use platform-native effects when the CI platform itself is the target.
GitHub release creation, npm publishing, Docker Hub push, and GitHub Pages deployment via platform APIs are naturally expressed as workflow steps.
There is no benefit to wrapping gh release create in a bubblewrap sandbox.
The platform-native model is also appropriate for effects that are trivially fast and have no meaningful build dependencies to verify.
A notification webhook that sends a JSON payload to a Slack endpoint does not benefit from the runIf closure-building property.
When uncertain, consider whether a pull request would benefit from building the effect's closure without executing it.
If yes, the nix-native model with runIf provides that property automatically.
If not, the platform-native model is simpler.
A repository can use both strategies simultaneously: nix-native effects for deployments and scheduled operations, platform-native effects for GitHub-specific integrations.
The two models are complementary, not mutually exclusive.
Binary caching operates at three tiers, each with distinct invalidation characteristics and storage costs.
The nix store on the local builder is the first tier.
It is populated by every nix build and nix flake check invocation.
Cache hits are instant (no network) but limited to the machine that performed the build.
On CI, the nix store's persistence depends on the runner infrastructure.
GitHub-hosted runners have ephemeral storage, so the nix store is empty at the start of each job.
Self-hosted runners (including buildbot-nix workers) have persistent storage, so the nix store accumulates builds across jobs and acts as a warm local cache.
This persistence difference is one of the practical motivations for phase 2 of the migration pattern.
The binary cache is the second tier.
A binary cache stores pre-built derivations indexed by store path hash, served over HTTP.
niks3 on Cloudflare R2 provides self-hosted storage with no free-tier eviction and cost proportional to usage.
Cachix provides managed convenience with integrated GitHub Actions support via cachix/cachix-action, at the cost of storage limits on free plans and eviction under sustained CI load.
Substituter ordering in nix.conf determines lookup priority: local store, then self-hosted cache, then cachix, then cache.nixos.org.
The order matters because nix tries each substituter in sequence and uses the first hit.
Placing the self-hosted cache first ensures project-specific derivations (which cache.nixos.org does not have) are served from the fast, project-local cache.
nixConfig.extra-substituters in flake.nix makes project-specific caches available to anyone who builds the flake without requiring manual nix.conf configuration.
The CI job-result cache is the third tier, operating above the nix layer entirely.
The cached-ci-job composite action computes SHA256 hashes of glob-matched source files to produce a cache key.
When the key matches a prior run, the entire GitHub Actions job skips without invoking nix at all.
This is orthogonal to nix store caching: it prevents job execution, not just derivation building.
Even if every nix derivation would be a cache hit, the CI job still spends time on checkout, nix daemon startup, nix-fast-build invocation, and cache synchronization.
The job-result cache eliminates all of that overhead for unchanged source sets.
Source filtering (described in the companion preferences-nix-checks-architecture skill) drives cache efficiency at the nix layer.
Content-addressed source paths (builtins.path with fixed name), language-specific filters (crane.filterCargoSources, lib.fileset.toSource), and lockfile-based dependency fetchers all minimize cache invalidation from unrelated changes.
The relationship between source filtering and cache efficiency is direct: every file included in a derivation's source input contributes to the derivation hash.
A change to any included file invalidates the cache entry.
Excluding irrelevant files (documentation, CI configuration, unrelated source directories) prevents cascading invalidation.
The cache-overlay-packages anti-pattern is a dedicated GitHub Actions job that builds overlay packages to warm the cache before other jobs run.
Under nix-fast-build, this is unnecessary because --skip-cached and binary cache integration handle caching as part of the normal build pipeline.
The dedicated job adds CI wall time without providing benefit when nix-fast-build is the build driver.
Cross-reference references/caching-strategies.md for detailed content-addressed source patterns, shared artifact patterns, and niks3 vs cachix tradeoff analysis.
The justfile serves as the developer-facing interface to both local and CI execution. CI workflows invoke justfile recipes rather than calling nix tooling directly, which keeps the CI YAML minimal and ensures developers can reproduce CI behavior locally.
The check recipe runs nix flake check with nom for interactive output.
This is the developer's primary feedback loop during local development.
It evaluates and builds all checks sequentially, providing clear per-check error output without interleaving.
The check-fast recipe runs nix-fast-build with the flags appropriate for CI: --skip-cached, --no-nom, --eval-workers 4, and --result-format junit.
CI workflows invoke just check-fast and upload the JUnit artifact.
Developers can also run just check-fast locally to validate cache behavior or reproduce CI-specific issues.
The build recipe builds a specific package or the default package.
The fmt recipe runs treefmt.
The lint recipe runs language-specific linters.
These recipes may invoke nix derivations or run tools directly, depending on whether the tool is available in the devshell or needs a nix build.
The convention of routing CI through justfile recipes means that CI workflow changes are rare. Adding a new check to the flake requires no CI workflow update because the check is discovered automatically by nix-fast-build. The only CI workflow changes needed are for structural changes: adding or removing CI jobs, changing the runner, or modifying the trigger conditions.
This indirection also simplifies debugging. When a CI job fails, the developer can reproduce the failure locally by running the same justfile recipe. There is no need to decipher GitHub Actions YAML to understand what the CI job actually does. The justfile recipe is the single source of truth for how a validation or build operation is invoked, used identically by developers and CI runners.
Repositories that target multiple systems (e.g., x86_64-linux and aarch64-darwin for a cross-platform tool) face a challenge: a single buildbot worker typically supports only one system.
Three approaches address this.
The split-attribute approach uses separate buildbot-nix.toml attribute scoping per forge.
A GitHub-hosted runner evaluates checks.aarch64-darwin via nix-fast-build in a GHA workflow, while the buildbot worker evaluates checks.x86_64-linux.
This hybrid retains GHA for systems that buildbot cannot build while delegating the primary system to buildbot.
The multi-worker approach provisions buildbot workers for each target system.
An aarch64-linux worker on a Hetzner ARM server and an x86_64-linux worker on a standard server together cover both linux architectures.
Darwin systems require a macOS worker, which is feasible with persistent macOS CI runners (e.g., a Mac Mini connected to the buildbot master).
Worker-capability heterogeneity is a further fan-out constraint orthogonal to system coverage: VM-based integration checks (nixosTest) and nspawn-container checks require the kvm and nixos-test sandbox features enabled on the nix daemon of any worker tasked to evaluate or build them, and workers lacking those features fail at evaluation or build time rather than producing a clean skip.
Process-compose checks wired as eval-gates (the runner package built but not executed) require no such features and can be assigned to any worker covering the target system.
Fan-out planning must therefore pair the check-set's regulator-kind composition (see preferences-nix-checks-architecture §"Choosing among integration regulators") with each worker's declared sandbox features, not system alone.
The cross-compilation approach builds non-native system outputs via cross-compilation on the available worker. This works for simple derivations but fails for checks that require native execution (test suites, linters, type checkers). Cross-compilation is appropriate for package builds but not for the full check surface.
The choice depends on the repository's system coverage and available infrastructure. Most repositories target a single primary system and do not need multi-system CI. Repositories that do should prefer the split-attribute approach initially and consider multi-worker as their infrastructure matures.
For nix-darwin repositories in the vanixiets fleet, the split-attribute approach is the current practice.
Darwin checks run locally on the developer's machine via just nix check, while linux checks are delegated to buildbot-nix on the Hetzner worker.
This division reflects the reality that darwin builders are developer workstations, not CI infrastructure, and should not be burdened with CI workloads.
CI/CD observability bridges to the CI/CD/CV (continuous validation) trichotomy described in preferences-production-readiness.
Three categories of signal provide visibility into pipeline health.
The "continuous validation" term used here and below refers to the narrow Rosenthal–Jones sense — runtime, adversarial, SLO-centered probing of deployed systems against their operating envelopes — and is distinct from the broader Compositional Continuous Verification (CCV) discipline that spans construction, integration, and runtime regulators under one closure operator.
See preferences-compositional-continuous-verification for the broader discipline; the narrow runtime sense is preserved verbatim throughout this section because that is the sense the surrounding prose actually invokes.
Avoid collapsing either to the bare abbreviation "CV" outside the established CI/CD/CV trichotomy shorthand inherited from preferences-production-readiness.
Cache hit rate is a leading indicator of CI efficiency. Declining hit rates signal source filtering regressions (a change to the filter function that broadened the input set), cache eviction (free-tier storage limits, retention policy changes), or infrastructure issues (cache endpoint unreachable, authentication failures). Tracking hit rate per check category identifies which categories are most affected. nix-fast-build's output includes cache lookup results for each derivation, making it possible to compute hit rates from CI logs without additional instrumentation.
JUnit output from nix-fast-build (--result-format junit) provides per-check visibility in CI dashboards.
Each check appears as a test case with pass/fail status, duration, and output.
CI platforms (GitHub Actions, Gitea Actions, buildbot's web UI) render JUnit XML natively, so no additional tooling is needed to surface per-check results.
The JUnit format also enables trend analysis across runs: a check that takes 30 seconds in one run and 5 minutes in the next is immediately visible in the CI platform's test duration charts.
Build time tracking per check category identifies performance regressions. When a check that previously completed in 30 seconds starts taking 5 minutes, the cause is typically a cache miss (dependency change, source filter regression) or a genuine build complexity increase. Distinguishing these two causes requires correlating build time with cache hit rate. A build time increase accompanied by a cache hit rate decrease points to a caching problem. A build time increase with stable cache hit rates points to genuine complexity growth or a dependency update that increased build time.
The dogfooding loop is a particularly valuable observability signal for infrastructure repositories. When buildbot-nix builds the repository that defines the buildbot-nix configuration (vanixiets building vanixiets), the pipeline validates itself end-to-end. A failing build on the buildbot-nix configuration repo means the next deployment of that configuration would break CI for all registered projects. This self-referential validation closes the loop between infrastructure changes and their operational impact. It also provides early warning for upstream breakage: when a nixpkgs update breaks the buildbot-nix configuration, the dogfooding build fails before the broken configuration is deployed.
The bridge to continuous validation (CV) from preferences-production-readiness is through the effect system.
Nix-native effects can implement CV checks: scheduled health probes, deployment verification tests, and post-deploy smoke tests.
The onSchedule interface provides the timing, the effect sandbox provides the execution environment, and the runIf gating pattern provides conditional execution based on deployment state.
A health probe scheduled every hour that verifies all deployed services are responding is a CV check implemented as a nix-native effect.
Its build dependencies (the probe script, the HTTP client, the expected-response definitions) are verified on every push, while the probe itself executes only on schedule.
The three observability categories (cache hit rate, per-check timing, dogfooding results) together provide sufficient signal to identify most CI health problems without requiring dedicated monitoring infrastructure. CI platforms already provide the dashboards; the nix-native CI approach ensures the data feeding those dashboards is structured and per-attribute rather than monolithic.
Merging is safe in this repository because of a loop, not because of any single check. The loop is only as trustworthy as the reading of its signals, so this section separates what each signal is evidence of from what it is not.
Every pull request gets one evaluation of the flake's check scope followed by per-attribute builds, and nixbot reports them as separate nixbot/nix-eval and nixbot/nix-build statuses alongside nixbot/effects.
The split is deliberate.
An evaluation error means the flake cannot even describe the derivation, which no builder could have caused and no retry will fix; a build failure means a described derivation failed to realize, which can be a regression, a flaky builder, or an absent one.
Collapsing the two into one status would force a reader to open logs to learn which kind of failure they are looking at.
An attribute reported as cached is not evidence that this run verified it.
It is evidence that a derivation with the identical store path, and therefore identical inputs, was built and verified before, and content addressing is what makes that earlier verification transfer to the current commit.
That is the point of the binary cache strategy above, and it is also its limit: a cached check is exactly as strong as the check was when it first ran, so a vacuous check stays vacuous at every cache hit (see §"Operationalizing integrity" in preferences-nix-checks-architecture).
Every check on every system CI builds is required, the aarch64-darwin checks included.
Those can only build on a Mac reachable from the CI host, and the Macs are laptops that sleep and travel, so until 2026-11-25 every darwin check carried hercules-ci's ignoreFailure, which removes a failure from the aggregate build status.
The flag encodes availability, not correctness: the CI system cannot tell an absent builder from a genuine regression, so a real darwin break passes as an ignored failure.
That happened twice, six Darwin closures once and build 2456 later, so the flag is gone, and checks.x86_64-linux.nixbot-wiring fails if a darwin check carries it again.
A darwin check that fails, or that no Mac could build, now fails the build, and with no Mac reachable nothing lands.
The emergency switch is attribute = "checks.x86_64-linux" in nixbot.toml, which restricts nixbot to the Linux checks from the first commit that carries it, with no deploy; never use ignoreFailure to make a red status go away.
A darwin evaluation error fails nix-eval whatever the builders do, which is correct for an error no builder could have caused.
When every required status is green, the merge queue (modules/nixos/gitea-mq.nix, required checks nixbot/nix-eval, nixbot/nix-build, nixbot/effects) lands the pull request.
The queue batches up to 20 pull requests and evaluates the batch once rather than each pull request separately, then fast-forwards the target to the exact tested batch commit.
Stacking several green pull requests into one batch therefore costs one evaluation instead of one per pull request, which matters once a single evaluation is measured in minutes and tens of GiB.
The loop only tightens if each run's cost is observable.
An evaluation scope that grows by accretion is invisible in a pass/fail status: in this repository CI evaluated 311 check attributes at ~92 GiB of evaluator allocation and ~400 s before anyone measured it, and two corrective pull requests brought it to 235 attributes, ~45 GiB, and ~218 s with no coverage anyone wanted lost.
Record evaluation wall time, peak memory, worker restarts, and attribute count per run alongside the cache hit rate and per-check timing described in §"Pipeline observability", and treat a rise in any of them as a regression to explain.
What to measure and how to attribute the cost to individual attributes is covered in references/evaluation-cost.md of preferences-nix-checks-architecture.
This skill sits at the intersection of several other preference skills, each covering a complementary aspect of the nix-based development workflow.
preferences-nix-checks-architecture covers check taxonomy, derivation patterns, source filtering, and flake-parts module organization.
It answers what to build; this skill answers where and how to run it.
The two skills are designed to be loaded together when working on CI pipeline design, as the check architecture directly determines the CI pipeline's structure.
The §"Choosing among integration regulators" three-way framing (process-compose / nspawn container test / full QEMU VM test) is the input to the worker-capability fan-out planning described above.
Its §"Evaluation cost as a design constraint" and references/evaluation-cost.md explain the per-worker fixed cost that drives --eval-workers sizing and that the merge-confidence loop must keep observable, and its §"Operationalizing integrity" and references/check-vacuity.md explain why a green or cached check is only evidence if the check could have failed.
preferences-nix-development covers flake conventions, module structure, and derivation best practices that underpin both check derivation design and the flake outputs that CI tools consume.
The perSystem convention from flake-parts determines the attribute paths that buildbot-nix.toml's attribute field references.
preferences-production-readiness defines the CI/CD/CV trichotomy, pipeline observability foundations, and progressive delivery patterns.
The effect execution strategies in this skill implement the CD layer of that trichotomy.
The pipeline observability section bridges to the CV layer through scheduled effects and health probes.
preferences-observability-engineering provides instrumentation patterns applicable to build pipeline telemetry: structured events for build completion, traces spanning evaluation through building, and SLO-based alerting on cache hit rates and build times.
When build pipeline telemetry is integrated with application observability, the full deployment lifecycle is visible from commit through build through deploy through production health.
preferences-secrets covers CI key strategies, sops-nix integration, and secret rotation patterns relevant to both platform-native and nix-native effect secret management.
The secretsMap pattern in nix-native effects and the perRepoSecretFiles configuration in buildbot-nix are the CI-specific instantiations of the general secrets management patterns.
preferences-web-application-deployment covers deployment patterns that may be implemented as either platform-native or nix-native effects, depending on the decision guidance in this skill's effect execution strategies section.
preferences-compositional-continuous-verification is the theoretical anchor for the broader compositional verification discipline and disambiguates from the narrow Continuous Validation sense used in this skill's pipeline observability section.
The closure operator that CCV defines is exactly what buildbot-nix executes in CI, so the operational machinery documented here is one realization of that theoretical commitment.
nix-flake-pr-cycle is the operational workflow that exercises the closure operator — the nix flake check invocation that buildbot-nix runs in CI — and ties the local-validation-then-PR habit to the CI gating described in this skill.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
nix-ci, flake-checks, buildbot-nix, nix-eval-jobs, nix-fast-build, binary-cache
/preferences-nix-and-secrets:preferences-nix-ci-cd-integrationfrom preferences-nix-and-secrets
npx claudepluginhub cameronraysmith/vanixiets --plugin preferences-nix-and-secrets4 skills in this plugin
/preferences-nix-checks-architectureDesign hermetic, cacheable nix flake checks for comprehensive repository validation. Use when structuring checks in flake-parts modules, wrapping language tools as pure derivations, designing nix-unit structural invariants, or planning NixOS VM integration tests. Also load when the 8-category check taxonomy (format, secrets-scan, lint, type-check, unit-test, integration/e2e, nix-infrastructure, build/eval) is relevant, when adding, gating, or reviewing any check (evaluation cost, attribute key-set strictness, nix-eval-jobs memory, per-system gating, nixpkgs instantiation count), when measuring or benchmarking flake evaluation, when judging whether a check is vacuous, tautological, duplicated, or placed on the wrong rung, or when assigning a check or VM test its size class or measuring how long one run takes.
/preferences-nix-developmentNix development conventions for flakes, derivations, modules, and code style. Use when authoring flake.nix files, writing derivations, builders or overlays, designing NixOS/nix-darwin/home-manager modules, deciding how configurations instantiate and share nixpkgs, editing flake input wiring or `follows`, bumping pinned upstream versions guarded by assertions (kernel modules, patched sources), or following nix formatting and naming conventions. For check architecture and CI integration, see preferences-nix-checks-architecture and preferences-nix-ci-cd-integration.
/preferences-secretsSecrets management practices for handling API keys, credentials, and sensitive configuration. Load when working with secrets, sops-nix, or credential storage.Other plugins' skills for the same job