1{
2 perSystem =
3 { pkgs, config, ... }:
4 {
5 formatter = pkgs.treefmt.withConfig {
6 runtimeInputs = with pkgs; [
7 nixfmt
8 shfmt
9 stylua
10 ];
11
12 settings = {
13 on-unmatched = "info";
14 tree-root-file = "flake.nix";
15
16 formatter = {
17 nixfmt = {
18 command = "nixfmt";
19 includes = [ "*.nix" ];
20 };
21
22 shfmt = {
23 command = "shfmt";
24 options = [
25 "-s"
26 "-w"
27 "-i"
28 "2"
29 ];
30 includes = [
31 "*.sh"
32 ];
33 };
34
35 stylua = {
36 command = "stylua";
37 includes = [ "*.lua" ];
38 };
39 };
40 };
41 };
42 };
43}