Remove 'pre-commit' check from flake

Since trying to run it results into a failure due to 'clippy' trying to
fetch the network inside the build sandbox, remove it from the 'checks'
for now, but do keep it around for its 'shellHook'.
This commit is contained in:
Bruno BELANYI 2022-07-25 16:40:56 +02:00
parent c8d7c17711
commit ae1c3322d5

View file

@ -80,44 +80,42 @@
rustc = my-rust; rustc = my-rust;
}; };
inherit (pkgs) lib; inherit (pkgs) lib;
in pre-commit =
rec { let
checks = { # See https://github.com/cachix/pre-commit-hooks.nix/issues/126
pre-commit = rust-env = pkgs.buildEnv {
let name = "rust-env";
# See https://github.com/cachix/pre-commit-hooks.nix/issues/126 buildInputs = [ pkgs.makeWrapper ];
rust-env = pkgs.buildEnv { paths = [ my-rust ];
name = "rust-env"; pathsToLink = [ "/" "/bin" ];
buildInputs = [ pkgs.makeWrapper ]; postBuild = ''
paths = [ my-rust ]; for i in $out/bin/*; do
pathsToLink = [ "/" "/bin" ]; wrapProgram "$i" --prefix PATH : "$out/bin"
postBuild = '' done
for i in $out/bin/*; do '';
wrapProgram "$i" --prefix PATH : "$out/bin" };
done in
''; pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
clippy = {
enable = true;
entry = lib.mkForce "${rust-env}/bin/cargo-clippy clippy";
}; };
in
pre-commit-hooks.lib.${system}.run {
src = self;
hooks = { nixpkgs-fmt = {
clippy = { enable = true;
enable = true; };
entry = lib.mkForce "${rust-env}/bin/cargo-clippy clippy";
};
nixpkgs-fmt = { rustfmt = {
enable = true; enable = true;
}; entry = lib.mkForce "${rust-env}/bin/cargo-fmt fmt -- --check --color always";
rustfmt = {
enable = true;
entry = lib.mkForce "${rust-env}/bin/cargo-fmt fmt -- --check --color always";
};
}; };
}; };
}; };
in
rec {
devShells = { devShells = {
default = pkgs.mkShell { default = pkgs.mkShell {
@ -131,7 +129,7 @@
my-rust my-rust
]; ];
inherit (checks.pre-commit) shellHook; inherit (pre-commit) shellHook;
RUST_SRC_PATH = "${my-rust}/lib/rustlib/src/rust/library"; RUST_SRC_PATH = "${my-rust}/lib/rustlib/src/rust/library";
}; };