Add treefmt formatter (nix fmt + flake check gate)
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# treefmt config, evaluated per-system in flake.nix and exposed as
|
||||
# `nix fmt` (the formatter) plus a `nix flake check` formatting gate.
|
||||
{ ... }:
|
||||
{
|
||||
projectRootFile = "flake.nix";
|
||||
|
||||
programs = {
|
||||
nixfmt.enable = true;
|
||||
prettier.enable = true;
|
||||
yamlfmt.enable = true;
|
||||
shfmt.enable = true;
|
||||
};
|
||||
|
||||
settings = {
|
||||
on-unmatched = "fatal";
|
||||
global.excludes = [
|
||||
# Secrets and clan-managed state — never reformat.
|
||||
"sops/*"
|
||||
"vars/*"
|
||||
"inventory.json"
|
||||
|
||||
# Generated — don't reformat (regeneration would churn the diff).
|
||||
"*facter.json"
|
||||
|
||||
# No formatter, or reformatting would corrupt them.
|
||||
"*.zone" # Knot zone files
|
||||
"flake.lock"
|
||||
".envrc"
|
||||
".gitignore"
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user