Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion flake/dev-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ _: {
{
devShells.default = pkgs.mkShell {
inputsFrom = [ config.treefmt.build.devShell ];
shellHook = config.pre-commit.installationScript;
# Warn before pre-commit's installer fires: a set core.hooksPath
# makes it refuse with "Cowardly refusing to install hooks with
# core.hooksPath set". The fix is to unset, not to bypass.
shellHook = ''
if [ -n "$(git config --get core.hooksPath 2>/dev/null)" ]; then
echo "WARN: core.hooksPath is set to '$(git config --get core.hooksPath)'." >&2
echo " pre-commit install will refuse. Unset it:" >&2
echo " git config --unset core.hooksPath # local" >&2
echo " git config --global --unset core.hooksPath # global" >&2
fi
${config.pre-commit.installationScript}
'';
packages = with pkgs; [
nixfmt-rfc-style
nil
Expand Down
Loading