-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformatter.nix
More file actions
58 lines (58 loc) · 1.12 KB
/
formatter.nix
File metadata and controls
58 lines (58 loc) · 1.12 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
treefmt-nix ?
import (builtins.fetchGit {
url = "https://github.com/numtide/treefmt-nix";
rev = "128222dc911b8e2e18939537bed1762b7f3a04aa";
}),
checkDir ? null,
lib,
stdenv,
writeShellScriptBin,
formats,
treefmt,
git,
git-lfs,
alejandra,
deadnix,
mdformat,
statix,
runCommandLocal,
yamlfmt,
}: let
treefmt-pkgs = let
# Restructure `python3Packages` exactly how treefmt-nix wants it
python3Packages = {inherit mdformat;};
in {
inherit
stdenv
lib
writeShellScriptBin
treefmt
git
git-lfs
formats
alejandra
deadnix
python3Packages
statix
runCommandLocal
yamlfmt
;
};
treefmt-settings = {
settings = {
allow-missing-formatter = false;
};
programs = {
alejandra.enable = true;
yamlfmt.enable = true;
mdformat.enable = true;
deadnix.enable = true;
statix.enable = true;
};
};
output = treefmt-nix.evalModule treefmt-pkgs treefmt-settings;
in
if checkDir == null
then output.config.build.wrapper
else output.config.build.check checkDir