From 08781aeef75909d42bc14f304855cde77c8d1a4e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 19 Mar 2024 16:30:24 +0100 Subject: [PATCH] dev: Fix pre-commit check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'pre-commit-hooks-nix': 'github:cachix/pre-commit-hooks.nix/0db2e67ee49910adfa13010e7f012149660af7f0' (2024-02-07) → 'github:hercules-ci/pre-commit-hooks.nix/d43e4853f578739ac2264eadcd18faa5aeb41889' (2024-03-19) (cherry picked from commit 32a59f0f81b70a95ec7fda598b5823e96d3f8270) --- flake.lock | 11 ++++++----- flake.nix | 9 +++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 11269fb..258898c 100644 --- a/flake.lock +++ b/flake.lock @@ -293,15 +293,16 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1707297608, - "narHash": "sha256-ADjo/5VySGlvtCW3qR+vdFF4xM9kJFlRDqcC9ZGI8EA=", - "owner": "cachix", + "lastModified": 1710862133, + "narHash": "sha256-+e62qOvW6svSU59SOVniBodNe0WkIYgfwXPazUyEBNE=", + "owner": "hercules-ci", "repo": "pre-commit-hooks.nix", - "rev": "0db2e67ee49910adfa13010e7f012149660af7f0", + "rev": "d43e4853f578739ac2264eadcd18faa5aeb41889", "type": "github" }, "original": { - "owner": "cachix", + "owner": "hercules-ci", + "ref": "rustfmt-all", "repo": "pre-commit-hooks.nix", "type": "github" } diff --git a/flake.nix b/flake.nix index 3505f8a..43c4b8d 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,8 @@ nix-cargo-integration.url = "github:yusdacra/nix-cargo-integration"; nix-cargo-integration.inputs.nixpkgs.follows = "nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix"; + # https://github.com/cachix/pre-commit-hooks.nix/pull/410 + pre-commit-hooks-nix.url = "github:hercules-ci/pre-commit-hooks.nix/rustfmt-all"; pre-commit-hooks-nix.inputs.nixpkgs.follows = "nixpkgs"; }; @@ -26,14 +27,14 @@ perSystem = { config, self', inputs', pkgs, ... }: { - + packages.nix = inputs'.nix.packages.nix; pre-commit.settings.hooks.nixpkgs-fmt.enable = true; # Temporarily disable rustfmt due to configuration issues # pre-commit.settings.hooks.rustfmt.enable = true; - # Override to pass `--all` - # pre-commit.settings.hooks.rustfmt.entry = lib.mkForce "${pkgs.rustfmt}/bin/cargo-fmt fmt --all --manifest-path ./rust/Cargo.toml -- --color always"; + # New configuration for rustfmt + pre-commit.settings.settings.rust.cargoManifestPath = "./rust/Cargo.toml"; devShells.default = pkgs.mkShell { name = "nix-bindings-devshell";