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";