Skip to content

Commit 623c562

Browse files
committed
show an example for devenv
1 parent 80479b6 commit 623c562

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,33 @@
1717

1818
### devenv.sh
1919

20-
https://devenv.sh/pre-commit-hooks/
20+
```nix
21+
{ inputs, ... }:
22+
23+
{
24+
git-hooks.hooks = {
25+
# lint shell scripts
26+
shellcheck.enable = true;
27+
# execute example shell from Markdown files
28+
mdsh.enable = true;
29+
# format Python code
30+
black.enable = true;
31+
32+
# override a package with a different version
33+
ormolu.enable = true;
34+
ormolu.package = pkgs.haskellPackages.ormolu;
35+
36+
# some hooks have more than one package, like clippy:
37+
clippy.enable = true;
38+
clippy.packageOverrides.cargo = pkgs.cargo;
39+
clippy.packageOverrides.clippy = pkgs.clippy;
40+
# some hooks provide settings
41+
clippy.settings.allFeatures = true;
42+
};
43+
}
44+
```
45+
46+
See [getting started](https://devenv.sh/getting-started/).
2147

2248
## Flakes support
2349

0 commit comments

Comments
 (0)