|
1 | 1 | {
|
2 | 2 | pkgs,
|
| 3 | + flake, |
3 | 4 | inputs,
|
4 | 5 | ...
|
5 |
| -}: |
6 |
| -inputs.treefmt-nix.lib.mkWrapper pkgs { |
7 |
| - projectRootFile = ".git/config"; |
| 6 | +}: let |
| 7 | + mod = inputs.treefmt-nix.lib.evalModule pkgs { |
| 8 | + projectRootFile = ".git/config"; |
8 | 9 |
|
9 |
| - programs = |
10 |
| - { |
11 |
| - alejandra.enable = true; |
12 |
| - deadnix.enable = true; |
13 |
| - gofumpt.enable = true; |
14 |
| - prettier.enable = true; |
15 |
| - statix.enable = true; |
16 |
| - } |
17 |
| - // pkgs.lib.optionalAttrs (pkgs.system != "riscv64-linux") { |
18 |
| - shellcheck.enable = true; |
19 |
| - }; |
| 10 | + programs = |
| 11 | + { |
| 12 | + alejandra.enable = true; |
| 13 | + deadnix.enable = true; |
| 14 | + gofumpt.enable = true; |
| 15 | + prettier.enable = true; |
| 16 | + statix.enable = true; |
| 17 | + } |
| 18 | + // pkgs.lib.optionalAttrs (pkgs.system != "riscv64-linux") { |
| 19 | + shellcheck.enable = true; |
| 20 | + }; |
20 | 21 |
|
21 |
| - settings = { |
22 |
| - global.excludes = [ |
23 |
| - "LICENSE" |
24 |
| - # unsupported extensions |
25 |
| - "*.{gif,png,svg,tape,mts,lock,mod,sum,toml,env,envrc,gitignore}" |
26 |
| - ]; |
| 22 | + settings = { |
| 23 | + global.excludes = [ |
| 24 | + "LICENSE" |
| 25 | + # unsupported extensions |
| 26 | + "*.{gif,png,svg,tape,mts,lock,mod,sum,toml,env,envrc,gitignore}" |
| 27 | + ]; |
27 | 28 |
|
28 |
| - formatter = { |
29 |
| - deadnix = { |
30 |
| - priority = 1; |
31 |
| - }; |
| 29 | + formatter = { |
| 30 | + deadnix = { |
| 31 | + priority = 1; |
| 32 | + }; |
32 | 33 |
|
33 |
| - statix = { |
34 |
| - priority = 2; |
35 |
| - }; |
| 34 | + statix = { |
| 35 | + priority = 2; |
| 36 | + }; |
36 | 37 |
|
37 |
| - alejandra = { |
38 |
| - priority = 3; |
39 |
| - }; |
| 38 | + alejandra = { |
| 39 | + priority = 3; |
| 40 | + }; |
40 | 41 |
|
41 |
| - prettier = { |
42 |
| - options = [ |
43 |
| - "--tab-width" |
44 |
| - "4" |
45 |
| - ]; |
46 |
| - includes = ["*.{css,html,js,json,jsx,md,mdx,scss,ts,yaml}"]; |
| 42 | + prettier = { |
| 43 | + options = [ |
| 44 | + "--tab-width" |
| 45 | + "4" |
| 46 | + ]; |
| 47 | + includes = ["*.{css,html,js,json,jsx,md,mdx,scss,ts,yaml}"]; |
| 48 | + }; |
47 | 49 | };
|
48 | 50 | };
|
49 | 51 | };
|
50 |
| -} |
| 52 | +in |
| 53 | + mod.config.build.wrapper |
| 54 | + // { |
| 55 | + # check formatting as part of `nix flake check` |
| 56 | + passthru.tests.check = mod.config.build.check flake; |
| 57 | + } |
0 commit comments