chore: git-hooks rustfmt and clippy

This commit is contained in:
Per Stark
2026-06-20 10:10:29 +02:00
parent 01ef1bcb7a
commit 09e545816e
29 changed files with 156 additions and 201 deletions
+17 -4
View File
@@ -4,19 +4,32 @@
config,
inputs,
...
}:
let
}: let
ortVersion = lib.removeSuffix "\n" (builtins.readFile "${toString ./.}/ort-version");
_ortVersionCheck =
if pkgs.onnxruntime.version == ortVersion
then null
else
throw "pkgs.onnxruntime.version (${pkgs.onnxruntime.version}) must match ort-version (${ortVersion})";
else throw "pkgs.onnxruntime.version (${pkgs.onnxruntime.version}) must match ort-version (${ortVersion})";
in {
devenv.warnOnNewVersion = false;
cachix.enable = false;
git-hooks.install.enable = true;
git-hooks.hooks = {
rustfmt.enable = true;
clippy = {
enable = true;
settings.allFeatures = true;
};
};
# Use pinned Rust toolchain from languages.rust for git-hooks wrappers
# (git-hooks.nix defaults to nixpkgs's cargo/clippy/rustfmt, ignoring the pin)
git-hooks.tools.cargo = lib.mkDefault config.languages.rust.toolchain.cargo;
git-hooks.tools.clippy = lib.mkDefault config.languages.rust.toolchain.clippy;
git-hooks.tools.rustfmt = lib.mkDefault config.languages.rust.toolchain.rustfmt;
packages = [
pkgs.openssl
pkgs.nodejs