-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clippy hook fails when run using nix flake check
#452
Comments
See #396 |
Maybe a stupid question, but I'm not gaining any insight from that PR. Is there any workaround to make these checks work in |
Workarounds: Use
Override the checks.pre-commit = pkgs.lib.mkForce (let
drv = config.pre-commit.settings.run;
in
pkgs.stdenv.mkDerivation {
name = "pre-commit-run";
src = config.pre-commit.settings.rootSrc;
buildInputs = [ pkgs.git pkgs.openssl pkgs.pkg-config ];
nativeBuildInputs = [pkgs.rustPlatform.cargoSetupHook];
cargoDeps = pkgs.rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
};
buildPhase = drv.buildCommand;
}); |
@sandydoo Thank you for that! |
Would still be nice to get this resolved in that PR! |
This is the relevant flake.parts code:
The hook works fine when run in a devShell, but it fails when run as a flake check, as there is no internet access, no access to the cargo cache. Error:
Maybe we should have a way to pass a
cargoDeps
derivation to allow it to run in a flake check.The text was updated successfully, but these errors were encountered: