forked from NotAShelf/nyx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fmt.nix
40 lines (35 loc) · 895 Bytes
/
fmt.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
perSystem = {
inputs',
config,
pkgs,
...
}: {
# provide the formatter for `nix fmt`
formatter = config.treefmt.build.wrapper;
# configure treefmt
treefmt = {
projectRootFile = "flake.nix";
programs = {
alejandra = {
enable = true;
package = inputs'.nyxpkgs.packages.alejandra-no-ads;
};
shellcheck.enable = true; # cannot be configured, errors on basic bash convention
prettier = {
enable = true;
package = pkgs.prettierd;
excludes = ["*.age"];
settings = {
editorconfig = true;
};
};
shfmt = {
enable = true;
# https://flake.parts/options/treefmt-nix.html#opt-perSystem.treefmt.programs.shfmt.indent_size
indent_size = 2; # set to 0 to use tabs
};
};
};
};
}