fmt: reformat *.toml with tombi, add tombi to treefmt.nix

This commit is contained in:
2026-08-29 09:49:32 +08:00
parent dd0097a1f8
commit 8b141b9da0
5 changed files with 53 additions and 43 deletions
+20 -5
View File
@@ -1,12 +1,27 @@
{ inputs, ... }:
{
imports = [ inputs.treefmt.flakeModule ];
perSystem.treefmt = {
{ inputs, ... }: {
imports = [
inputs.treefmt.flakeModule
];
perSystem.treefmt = { lib, pkgs, ... }: {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
stylua.enable = true;
keep-sorted.enable = true;
stylua.enable = true;
};
settings.formatter.tombi = {
command = "${pkgs.bash}/bin/bash";
options = [
"-euc"
''
for file in "$@"; do
${lib.getExe pkgs.tombi} fmt $file
done
''
"--"
];
includes = [ "*.toml" ];
};
settings.excludes = [ "secrets/*" ];
};
}