-
Notifications
You must be signed in to change notification settings - Fork 1
/
devshell.nix
51 lines (46 loc) · 1.05 KB
/
devshell.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
41
42
43
44
45
46
47
48
49
50
51
{...}: {
perSystem = {
config,
pkgs,
...
}: {
treefmt.config = {
inherit (config.flake-root) projectRootFile;
package = pkgs.treefmt;
flakeCheck = false;
programs = {
alejandra.enable = true;
deadnix.enable = true;
shfmt.enable = true;
dprint = {
enable = true;
};
taplo.enable = true;
stylua.enable = true;
};
};
pre-commit = {
check.enable = true;
settings.hooks = {
treefmt.enable = true;
shellcheck.enable = true;
gitleaks = {
enable = true;
name = "gitleaks";
entry = "${pkgs.gitleaks}/bin/gitleaks protect --verbose --redact --staged";
language = "system";
pass_filenames = false;
};
lua-ls.enable = true;
};
};
formatter = config.treefmt.build.wrapper;
devshells.default = {
devshell.startup = {
pre-commit.text = ''
${config.pre-commit.installationScript}
'';
};
};
};
}