Skip to content

Commit f296278

Browse files
committed
nix: add taplo to 'nix fmt' wrapper
Signed-off-by: NotAShelf <[email protected]> Change-Id: I6a6a69640bd938da0cb79a6e26310d121e72a53e
1 parent 4b59346 commit f296278

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

flake.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,15 @@
119119
runtimeInputs = [
120120
pkgs.nixfmt
121121
pkgs.fd
122+
pkgs.taplo
122123
];
123124

124125
text = ''
125126
# Find Nix files in the tree and format them with Alejandra
126127
fd "$@" -t f -e nix -x nixfmt -q '{}'
128+
129+
# Same for TOML files, but with Taplo
130+
fd "$@" -t f -e toml -x taplo fmt '{}'
127131
'';
128132
};
129133

@@ -133,7 +137,7 @@
133137
# Check if codebase is properly formatted.
134138
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
135139
# or with `nix flake check`
136-
nix-fmt = pkgs.runCommand "nix-fmt-check" { nativeBuildInputs = [ pkgs.alejandra ]; } ''
140+
nix-fmt = pkgs.runCommand "nix-fmt-check" { nativeBuildInputs = [ pkgs.nixfmt ]; } ''
137141
nixfmt --check ${self} < /dev/null | tee $out
138142
'';
139143
};

0 commit comments

Comments
 (0)