Skip to content

feat(nix): add flake formatter + checks and a nix flake check CI gate - #680

Merged
c-vigo merged 3 commits into
feature/625-nix-claude-migrationfrom
feature/674-flake-quality-gates
Jun 24, 2026
Merged

c-vigo merged 3 commits into
feature/625-nix-claude-migrationfrom
feature/674-flake-quality-gates

Conversation

@c-vigo

@c-vigo c-vigo commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Nix flake quality gates so the toolchain SSoT (flake.nix) is itself gated.

  • formatter output — pkgs.nixfmt-rfc-style, so nix fmt formats every *.nix file idempotently.
  • nixfmt pre-commit hook — nixfmt --check on *.nix (fails on unformatted files); nixfmt is sourced from the flake dev-shell (nixfmt-rfc-style added to devTools), matching the taplo/shellcheck system-hook pattern.
  • checks output — lightweight flake checks run by nix flake check: a nixfmt --check format gate, a dev-shell build, and a devShellTools eval.
  • CI gate — a nix flake check --accept-flake-config step in the project-checks job (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 runs nix eval/nix develop cannot work. It stays in CI as a pytest; this reasoning is documented in a flake.nix comment.

nix-image.yml is intentionally untouched (owned by a sibling PR).

Verification

  • nix flake check --accept-flake-config → all checks passed!
  • nix fmt is idempotent (no diff on re-run).
  • New tests tests/test_flake_checks.py (formatter is nixfmt, checks exposes the gates, nix flake check succeeds) and the existing parity test all pass (5/5).
  • nixfmt pre-commit hook passes on all three tracked .nix files.

Closes #674

c-vigo added 3 commits June 24, 2026 13:42
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
c-vigo force-pushed the feature/674-flake-quality-gates branch from b77e23f to ca4efc8 Compare June 24, 2026 11:44
@c-vigo
c-vigo merged commit c4671fd into feature/625-nix-claude-migration Jun 24, 2026
1 check passed
@c-vigo
c-vigo deleted the feature/674-flake-quality-gates branch June 24, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant