Skip to content

Commit 648bada

Browse files
committed
nix: add fmt back
1 parent 1b7db2b commit 648bada

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

formatter.nix

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
pname,
3+
pkgs,
4+
}: let
5+
formatter = pkgs.writeShellApplication {
6+
name = pname;
7+
8+
runtimeInputs = [
9+
pkgs.alejandra
10+
];
11+
12+
text = ''
13+
if [ $# -eq 0 ]; then
14+
set -- "$(git rev-parse --show-toplevel 2>/dev/null || echo .)"
15+
fi
16+
17+
alejandra "$@"
18+
'';
19+
20+
meta = {
21+
description = "format your project";
22+
};
23+
};
24+
in
25+
formatter
26+
// {
27+
passthru = formatter.passthru;
28+
}

0 commit comments

Comments
 (0)