Add treefmt-nix formatting and CI checks #112

Closed
opened 2026-07-28 08:22:22 +01:00 by nimmo · 0 comments
Owner

Goal

Provide one reproducible formatting interface for the repository and enforce it in validation.

Scope

  • Evaluate and add treefmt-nix or an equivalent flake-native treefmt integration.
  • Define formatting for Nix and shell files first, using the repository's pinned tool versions.
  • Expose nix fmt as the canonical formatting command.
  • Add a formatting check to nix flake check or the authoritative Forgejo validation workflow.
  • Keep just as an optional convenience wrapper only where it adds useful context.
  • Decide whether existing formatter helpers and shell lint commands should delegate to the new interface.

Non-goals

  • Do not introduce Pedantix or attribute-ordering rules in the first pass.
  • Do not reformat the entire repository without reviewing the resulting diff.
  • Do not replace operational Just workflows such as deploy-remote or test.

Acceptance criteria

  • A clean checkout can run nix fmt reproducibly.
  • CI fails when tracked Nix or shell files are not formatted.
  • Formatter versions and exclusions are declared in the flake.
  • Existing shellcheck, actionlint, and Nix validation remain functional.
  • README documents the canonical formatting and validation commands.
  • Initial adoption produces a reviewed, bounded formatting diff.
## Goal Provide one reproducible formatting interface for the repository and enforce it in validation. ## Scope - Evaluate and add `treefmt-nix` or an equivalent flake-native treefmt integration. - Define formatting for Nix and shell files first, using the repository's pinned tool versions. - Expose `nix fmt` as the canonical formatting command. - Add a formatting check to `nix flake check` or the authoritative Forgejo validation workflow. - Keep `just` as an optional convenience wrapper only where it adds useful context. - Decide whether existing formatter helpers and shell lint commands should delegate to the new interface. ## Non-goals - Do not introduce Pedantix or attribute-ordering rules in the first pass. - Do not reformat the entire repository without reviewing the resulting diff. - Do not replace operational Just workflows such as `deploy-remote` or `test`. ## Acceptance criteria - A clean checkout can run `nix fmt` reproducibly. - CI fails when tracked Nix or shell files are not formatted. - Formatter versions and exclusions are declared in the flake. - Existing shellcheck, actionlint, and Nix validation remain functional. - README documents the canonical formatting and validation commands. - Initial adoption produces a reviewed, bounded formatting diff.
nimmo closed this issue 2026-07-28 09:14:56 +01:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config#112
No description provided.