diff --git a/README.md b/README.md index 4d6d334c..579068e1 100644 --- a/README.md +++ b/README.md @@ -531,6 +531,7 @@ hooks](modules/pre-commit.nix). ### Rust - [cargo-check](https://doc.rust-lang.org/cargo/commands/cargo-check.html) +- [cargo-sort](https://github.com/DevinR528/cargo-sort) - [clippy](https://github.com/rust-lang/rust-clippy) - [rustfmt](https://github.com/rust-lang/rustfmt) diff --git a/modules/hooks.nix b/modules/hooks.nix index 7a9e667c..50d29f0a 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -2734,6 +2734,16 @@ in files = "\\.rs$"; pass_filenames = false; }; + cargo-sort = + { + name = "cargo-sort"; + description = "Ensure Cargo.toml is sorted."; + package = tools.cargo-sort; + entry = "${hooks.cargo-sort.package}/bin/cargo-sort"; + files = "Cargo\\.toml"; + types = [ "file" "toml" ]; + pass_filenames = false; + }; chart-testing = { name = "chart-testing"; diff --git a/nix/tools.nix b/nix/tools.nix index 3026b7b7..62037a2b 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -10,6 +10,7 @@ , cabal2nix , callPackage , cargo +, cargo-sort , chart-testing , checkmake , circleci-cli @@ -134,6 +135,7 @@ in biome cabal2nix cargo + cargo-sort chart-testing checkmake circleci-cli