We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4c09990 + b24ef71 commit 15a87ceCopy full SHA for 15a87ce
modules/pre-commit.nix
@@ -86,15 +86,15 @@ let
86
run =
87
mkDerivation {
88
name = "pre-commit-run";
89
-
90
src = cfg.rootSrc;
91
buildInputs = [ cfg.gitPackage ];
92
nativeBuildInputs = enabledExtraPackages
93
++ lib.optional (config.settings.rust.check.cargoDeps != null) cargoSetupHook;
94
cargoDeps = config.settings.rust.check.cargoDeps;
95
buildPhase = ''
96
set +e
97
- HOME=$PWD
+ # Set HOME to a temporary directory for pre-commit to create its cache files in.
+ HOME=$(mktemp -d)
98
ln -fs ${configFile} .pre-commit-config.yaml
99
git init -q
100
git add .
@@ -111,6 +111,7 @@ let
111
fi
112
exitcode=$?
113
git --no-pager diff --color
114
+ # Derivations must produce an output
115
mkdir $out
116
[ $? -eq 0 ] && exit $exitcode
117
'';
0 commit comments