Repository navigation
feat(nix): add flake formatter + checks and a nix flake check CI gate - #680
Merged
c-vigo merged 3 commits intoJun 24, 2026
Merged
Conversation
Add a nixfmt-rfc-style formatter output (nix fmt), a nixfmt --check pre-commit hook, lightweight flake checks (format check, dev-shell build, devShellTools eval), and a nix flake check --accept-flake-config step in the CI project-checks job. The richer pytest dev-shell parity test stays in CI because nix checks build sandboxed without recursive nix access. Refs: #674
c-vigo
force-pushed
the
feature/674-flake-quality-gates
branch
from
June 24, 2026 11:44
b77e23f to
ca4efc8
Compare
This was referenced Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Nix flake quality gates so the toolchain SSoT (
flake.nix) is itself gated.formatteroutput —pkgs.nixfmt-rfc-style, sonix fmtformats every*.nixfile idempotently.nixfmtpre-commit hook —nixfmt --checkon*.nix(fails on unformatted files);nixfmtis sourced from the flake dev-shell (nixfmt-rfc-styleadded todevTools), matching the taplo/shellcheck system-hook pattern.checksoutput — lightweight flake checks run bynix flake check: anixfmt --checkformat gate, a dev-shell build, and adevShellToolseval.nix flake check --accept-flake-configstep in theproject-checksjob (Nix + the flake dev-shell are already provisioned there).The richer pytest dev-shell/image parity test (
tests/test_flake_devshell.py) is not wrapped as a flake check: nix checks build sandboxed without recursive nix access, so a check that itself runsnix eval/nix developcannot work. It stays in CI as a pytest; this reasoning is documented in aflake.nixcomment.nix-image.ymlis intentionally untouched (owned by a sibling PR).Verification
nix flake check --accept-flake-config→all checks passed!nix fmtis idempotent (no diff on re-run).tests/test_flake_checks.py(formatter is nixfmt,checksexposes the gates,nix flake checksucceeds) and the existing parity test all pass (5/5).nixfmtpre-commit hook passes on all three tracked.nixfiles.Closes #674