Skip to content

Commit b26808a

Browse files
committed
feat(templates): demo extraModulesPath usage
in the `flake-parts` template.
1 parent db249c9 commit b26808a

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

templates/flake-parts/flake.nix

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,25 @@
2525
perSystem =
2626
{ pkgs, ... }:
2727
{
28-
devshells.default = { };
28+
devshells.default = (
29+
{ extraModulesPath, ... }@args:
30+
{
31+
# `extraModulesPath` provides access to additional modules that are
32+
# not included in the standard devshell modules list.
33+
#
34+
# Please see https://numtide.github.io/devshell/extending.html for
35+
# documentation on consuming extra modules, and see
36+
# https://github.com/numtide/devshell/tree/main/extra for the
37+
# extra modules that are currently available.
38+
imports = [ "${extraModulesPath}/git/hooks.nix" ];
39+
40+
git.hooks.enable = false;
41+
git.hooks.pre-commit.text = ''
42+
echo 1>&2 'time to implement a pre-commit hook!'
43+
exit 1
44+
'';
45+
}
46+
);
2947
};
3048
};
3149
}

0 commit comments

Comments
 (0)