flakelight/builtin-modules/pre-commit-hook.nix

11 lines
292 B
Nix
Raw Normal View History

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