You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
guardrails: export the vendored gates as a stable package (consumable without mkProjectShell) #1572
#1488 vendored the guardrails gates as a capability module, and #1492 settled that the module contributes packages only (hook entries are scaffold-rendered; committed consumer configs are never overwritten). The wrapping is the valuable half for any consumer: gate runtime deps (bash, jq, ripgrep, gawk, …) resolve from the store instead of PATH, and checks.guardrails-canary proves each gate rejects a known-bad fixture.
But the gates derivation is internal: guardrailsPkg = pkgs.callPackage ./nix/guardrails.nix { } lives in a let and is reachable only through mkProjectShell's modules = [ "guardrails" ]. packages.<system> exposes only services (plus the Linux-only image targets).
That leaves a gap for a consumer that already owns its dev shell and a committed prek/pre-commit config. The module's own compatibility decision anticipates exactly this consumer — names, GUARDRAILS_* env vars, and hook ids are preserved verbatim so existing configs keep working — yet such a consumer cannot take the wrapped gates through any stable API. The workarounds are:
adopt mkProjectShell wholesale (a shell migration, when only the gate binaries are wanted), or
import the internal path (pkgs.callPackage "${devkit}/nix/guardrails.nix" { }) — works, but it is not contract and can break on any refactor.
Ask
Export the wrapped gates as packages.<system>.guardrails (the derivation already exists; this is surfacing, not new packaging).
Optionally, make the execution-proof reusable: either expose the canary as a consumer-usable check, or document that $out/share/guardrails/gates/test-gates.sh (already shipped) is the supported way for a consumer to assert gate execution in its own flake.
It keeps the scaffold optional, matching the module header's stance that hook entries belong to the scaffold side.
It widens adoption of the hermetic wrapping — the failure it fixes ("hooks resolved from a developer's global profile, worked there, failed in CI") is called out in nix/guardrails.nix itself as the motivating incident.
Resolved by #1799 (merged to dev, ships with the next release): packages.<system>.guardrails is exported on every system, and docs/NIX.md documents it as the supported API plus $out/share/guardrails/gates/test-gates.sh as the execution proof. The second ask is answered with docs only; no new consumer-facing check.
Activity
test: add failing test for packages.<system>.guardrails export
feat: export packages.<system>.guardrails
docs: document packages.<system>.guardrails as the supported API
feat: export packages.<system>.guardrails (#1799)
c-vigo commentedon Oct 1, 2026
Resolved by #1799 (merged to
dev, ships with the next release):packages.<system>.guardrailsis exported on every system, anddocs/NIX.mddocuments it as the supported API plus$out/share/guardrails/gates/test-gates.shas the execution proof. The second ask is answered with docs only; no new consumer-facing check.chore: release 1.18.0 (#1819)