Skip to content

Commit

Permalink
build: fix pre-commit installation on the nix-shell
Browse files Browse the repository at this point in the history
Signed-off-by: Tiago Castro <[email protected]>
  • Loading branch information
tiagolobocastro committed Oct 31, 2024
1 parent 2e992d0 commit 0f7321a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nix/shell/ci.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{ pkgs }:
let
inPureNixShell = builtins.getEnv "IN_NIX_SHELL" == "pure";
nixShellPurity = builtins.getEnv "IN_NIX_SHELL";
in
{
buildInputs = with pkgs; [
pre-commit
];

shellHook = ''
if [ -z "$CI" ] && [ "${toString inPureNixShell}" == "0" ]; then
if [ -z "$CI" ] && [ "${nixShellPurity}" == "impure" ]; then
echo "Installing CI pre-commit hooks..."
pre-commit install
pre-commit install --hook commit-msg
Expand Down

0 comments on commit 0f7321a

Please sign in to comment.