1
1
forked from extern/flakelight
flakelight/builtin-modules/pre-commit-hook.nix
2023-04-16 16:51:08 -07:00

11 lines
292 B
Nix

_: {
shellHook = { lib, flakelite }: ''
if [ -f flake.nix ] && [ -d .git/hooks ] &&
[ ! -f .git/hooks/pre-commit ]; then
echo Installing git pre-commit hook...
cp ${lib.getExe flakelite.inputs'.flakelite.packages.pre-commit-hook
} .git/hooks
fi
'';
}