about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/rust
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/rust')
-rw-r--r--nixpkgs/pkgs/development/tools/rust/bindgen/default.nix75
-rwxr-xr-xnixpkgs/pkgs/development/tools/rust/bindgen/wrapper.sh36
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-all-features/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-asm/default.nix28
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-binutils/Cargo.lock419
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-binutils/default.nix34
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-bisect-rustc/0001-dynamically-patchelf-binaries.patch56
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-bisect-rustc/default.nix56
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-bitbake/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-bloat/default.nix24
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-c/default.nix61
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-cache/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-crev/default.nix45
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-criterion/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-cross/default.nix41
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-deadlinks/default.nix31
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-deny/default.nix36
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-dephell/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-diet/default.nix23
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-embed/default.nix36
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-expand/default.nix25
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-feature/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-flash/default.nix35
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-fund/default.nix29
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-fuzz/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-geiger/default.nix42
-rwxr-xr-xnixpkgs/pkgs/development/tools/rust/cargo-geiger/update-cargo-lock.sh19
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-generate/default.nix33
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-inspect/default.nix24
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-insta/default.nix24
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-limit/default.nix36
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-llvm-lines/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-make/default.nix42
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-modules/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-msrv/default.nix46
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-play/default.nix28
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-raze/default.nix32
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-readme/default.nix34
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-rr/default.nix40
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-sort/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-spellcheck/default.nix32
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-supply-chain/default.nix23
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-sweep/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-sync-readme/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-tally/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-udeps/default.nix31
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-valgrind/default.nix43
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-watch/default.nix30
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-whatfeatures/default.nix27
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-wipe/default.nix32
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cargo-xbuild/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/rust/cbindgen/default.nix38
-rw-r--r--nixpkgs/pkgs/development/tools/rust/crate2nix/default.nix48
-rw-r--r--nixpkgs/pkgs/development/tools/rust/maturin/default.nix49
-rw-r--r--nixpkgs/pkgs/development/tools/rust/maturin/pyo3-test/Cargo.lock.patch688
-rw-r--r--nixpkgs/pkgs/development/tools/rust/maturin/pyo3-test/default.nix12
-rw-r--r--nixpkgs/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix45
-rw-r--r--nixpkgs/pkgs/development/tools/rust/panamax/default.nix24
-rw-r--r--nixpkgs/pkgs/development/tools/rust/probe-run/default.nix27
-rw-r--r--nixpkgs/pkgs/development/tools/rust/racer/default.nix48
-rw-r--r--nixpkgs/pkgs/development/tools/rust/racerd/default.nix45
-rw-r--r--nixpkgs/pkgs/development/tools/rust/rhack/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix64
-rw-r--r--nixpkgs/pkgs/development/tools/rust/rust-analyzer/ignore-git-and-rustfmt-tests.patch18
-rw-r--r--nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-1-55-control-flow.patch212
-rwxr-xr-xnixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh77
-rw-r--r--nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix15
-rw-r--r--nixpkgs/pkgs/development/tools/rust/rust-script/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/rust/rustup-toolchain-install-master/0001-dynamically-patchelf-binaries.patch61
-rw-r--r--nixpkgs/pkgs/development/tools/rust/rustup-toolchain-install-master/default.nix56
-rw-r--r--nixpkgs/pkgs/development/tools/rust/rustup/0001-dynamically-patchelf-binaries.patch42
-rw-r--r--nixpkgs/pkgs/development/tools/rust/rustup/default.nix92
-rw-r--r--nixpkgs/pkgs/development/tools/rust/sqlx-cli/default.nix30
-rw-r--r--nixpkgs/pkgs/development/tools/rust/svd2rust/cargo-lock.patch493
-rw-r--r--nixpkgs/pkgs/development/tools/rust/svd2rust/default.nix26
75 files changed, 4298 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/rust/bindgen/default.nix b/nixpkgs/pkgs/development/tools/rust/bindgen/default.nix
new file mode 100644
index 000000000000..57d5c1e64d2f
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/bindgen/default.nix
@@ -0,0 +1,75 @@
+{ lib, fetchFromGitHub, rustPlatform, clang, llvmPackages_latest, rustfmt, writeTextFile
+, runtimeShell
+, bash
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "rust-bindgen";
+  version = "0.59.1";
+
+  RUSTFLAGS = "--cap-lints warn"; # probably OK to remove after update
+
+  src = fetchFromGitHub {
+    owner = "rust-lang";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-nCww9sr6kF7nCQeIGtOXddxD3dR/SJ0rqAc+RlZnUkQ=";
+  };
+
+  cargoSha256 = "sha256-3EXYC/mwzVxo/ginvF1WFtS7ABE/ybyuKb58uMqfTDs=";
+
+  #for substituteAll
+  libclang = llvmPackages_latest.libclang.lib;
+  inherit bash;
+
+  buildInputs = [ libclang ];
+
+  propagatedBuildInputs = [ clang ]; # to populate NIX_CXXSTDLIB_COMPILE
+
+  configurePhase = ''
+    export LIBCLANG_PATH="${libclang.lib}/lib"
+  '';
+
+  postInstall = ''
+    mv $out/bin/{bindgen,.bindgen-wrapped};
+    substituteAll ${./wrapper.sh} $out/bin/bindgen
+    chmod +x $out/bin/bindgen
+  '';
+
+  doCheck = true;
+  checkInputs =
+    let fakeRustup = writeTextFile {
+      name = "fake-rustup";
+      executable = true;
+      destination = "/bin/rustup";
+      text = ''
+        #!${runtimeShell}
+        shift
+        shift
+        exec "$@"
+      '';
+    };
+  in [
+    rustfmt
+    fakeRustup # the test suite insists in calling `rustup run nightly rustfmt`
+    clang
+  ];
+  preCheck = ''
+    # for the ci folder, notably
+    patchShebangs .
+  '';
+
+  meta = with lib; {
+    description = "Automatically generates Rust FFI bindings to C (and some C++) libraries";
+    longDescription = ''
+      Bindgen takes a c or c++ header file and turns them into
+      rust ffi declarations.
+      As with most compiler related software, this will only work
+      inside a nix-shell with the required libraries as buildInputs.
+    '';
+    homepage = "https://github.com/rust-lang/rust-bindgen";
+    license = with licenses; [ bsd3 ];
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ johntitor ralith ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/bindgen/wrapper.sh b/nixpkgs/pkgs/development/tools/rust/bindgen/wrapper.sh
new file mode 100755
index 000000000000..0b3e3cd4c1e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/bindgen/wrapper.sh
@@ -0,0 +1,36 @@
+#!@bash@/bin/bash
+sep='--'   # whether to add -- before new options
+cxx=0      # whether cxx was explicitly requested
+lastWasx=0 # whether the last argument passed was -x
+for e in "$@"; do
+  if [[ "$e" == "--" ]]; then
+    sep=
+  fi;
+  if [[ "$sep" == "" ]]; then
+    # we look for -x c++ after -- only
+    if [[ "$e" == "-x" ]]; then
+      lastWasx=1
+    fi;
+    if [[ $lastWasx -eq 1 && "$e" == "c++" ]]; then
+      lastWasx=0
+      cxx=1
+    fi;
+    if [[ "$e" == "-xc++" || "$e" == -std=c++* ]]; then
+      cxx=1
+    fi;
+  fi;
+done;
+cxxflags=
+if [[ $cxx -eq 1 ]]; then
+  cxxflags=$NIX_CXXSTDLIB_COMPILE
+fi;
+if [[ -n "$NIX_DEBUG" ]]; then
+  set -x;
+fi;
+export LIBCLANG_PATH="@libclang@/lib"
+# shellcheck disable=SC2086
+# cxxflags and NIX_CFLAGS_COMPILE should be word-split
+exec -a "$0" @out@/bin/.bindgen-wrapped "$@" $sep $cxxflags $NIX_CFLAGS_COMPILE
+# note that we add the flags after $@ which is incorrect. This is only for the sake
+# of simplicity.
+
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-all-features/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-all-features/default.nix
new file mode 100644
index 000000000000..3d36b42ebe7c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-all-features/default.nix
@@ -0,0 +1,22 @@
+{ lib, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-all-features";
+  version = "1.6.0";
+
+  src = fetchFromGitHub {
+    owner = "frewsxcv";
+    repo = pname;
+    rev = version;
+    sha256 = "1pdr34ygc0qmh0dyrw1qcrh1vgg9jv9lm6ypl3fgjzz7npdj1dw4";
+  };
+
+  cargoSha256 = "sha256-BsRJo55gYT8OkDUBepWq48sW7QPt5OZkm8RR9f7HqZY=";
+
+  meta = with lib; {
+    description = "A Cargo subcommand to build and test all feature flag combinations";
+    homepage = "https://github.com/frewsxcv/cargo-all-features";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-asm/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-asm/default.nix
new file mode 100644
index 000000000000..68d5a256bbf4
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-asm/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, rustPlatform, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-asm";
+  version = "2019-12-24";
+
+  src = fetchFromGitHub {
+    owner = "gnzlbg";
+    repo = "cargo-asm";
+    rev = "577f890ebd4a09c8265710261e976fe7bfce8668";
+    sha256 = "1f6kzsmxgdms9lq5z9ynnmxymk9k2lzlp3caa52wqjvdw1grw0rb";
+  };
+
+  cargoSha256 = "1c22aal3i7zbyxr2c41fimfx13fwp9anmhh641951yd7cqb8xij2";
+
+  buildInputs = lib.optional stdenv.isDarwin Security;
+
+  # Test checks against machine code output, which fails with some
+  # LLVM/compiler versions.
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Display the assembly or LLVM-IR generated for Rust source code";
+    homepage = "https://github.com/gnzlbg/cargo-asm";
+    license = licenses.mit;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-binutils/Cargo.lock b/nixpkgs/pkgs/development/tools/rust/cargo-binutils/Cargo.lock
new file mode 100644
index 000000000000..a1e4cdde3b87
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-binutils/Cargo.lock
@@ -0,0 +1,419 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "addr2line"
+version = "0.14.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7"
+dependencies = [
+ "gimli",
+]
+
+[[package]]
+name = "adler"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
+
+[[package]]
+name = "aho-corasick"
+version = "0.7.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "ansi_term"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "anyhow"
+version = "1.0.37"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee67c11feeac938fae061b232e38e0b6d94f97a9df10e6271319325ac4c56a86"
+
+[[package]]
+name = "atty"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
+dependencies = [
+ "hermit-abi",
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "autocfg"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
+
+[[package]]
+name = "backtrace"
+version = "0.3.55"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ef5140344c85b01f9bbb4d4b7288a8aa4b3287ccef913a14bcc78a1063623598"
+dependencies = [
+ "addr2line",
+ "cfg-if",
+ "libc",
+ "miniz_oxide",
+ "object",
+ "rustc-demangle",
+]
+
+[[package]]
+name = "bitflags"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
+
+[[package]]
+name = "cargo-binutils"
+version = "0.3.3"
+dependencies = [
+ "anyhow",
+ "cargo_metadata",
+ "clap",
+ "regex",
+ "rustc-cfg",
+ "rustc-demangle",
+ "rustc_version",
+ "serde",
+ "toml",
+]
+
+[[package]]
+name = "cargo_metadata"
+version = "0.11.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a3a567c24b86754d629addc2db89e340ac9398d07b5875efcff837e3878e17ec"
+dependencies = [
+ "semver 0.10.0",
+ "serde",
+ "serde_json",
+]
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "clap"
+version = "2.33.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
+dependencies = [
+ "ansi_term",
+ "atty",
+ "bitflags",
+ "strsim",
+ "textwrap",
+ "unicode-width",
+ "vec_map",
+]
+
+[[package]]
+name = "failure"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86"
+dependencies = [
+ "backtrace",
+ "failure_derive",
+]
+
+[[package]]
+name = "failure_derive"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+ "synstructure",
+]
+
+[[package]]
+name = "gimli"
+version = "0.23.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce"
+
+[[package]]
+name = "hermit-abi"
+version = "0.1.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "itoa"
+version = "0.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
+
+[[package]]
+name = "lazy_static"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+
+[[package]]
+name = "libc"
+version = "0.2.81"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb"
+
+[[package]]
+name = "memchr"
+version = "2.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
+
+[[package]]
+name = "miniz_oxide"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d"
+dependencies = [
+ "adler",
+ "autocfg",
+]
+
+[[package]]
+name = "object"
+version = "0.22.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397"
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
+dependencies = [
+ "unicode-xid",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "regex"
+version = "1.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+ "thread_local",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.6.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189"
+
+[[package]]
+name = "rustc-cfg"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ad221fe7cd09334f8735dcc157b1178e343f43dfaefcd1b09d7fd4fc0921b6f"
+dependencies = [
+ "failure",
+]
+
+[[package]]
+name = "rustc-demangle"
+version = "0.1.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232"
+
+[[package]]
+name = "rustc_version"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
+dependencies = [
+ "semver 0.9.0",
+]
+
+[[package]]
+name = "ryu"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
+
+[[package]]
+name = "semver"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
+dependencies = [
+ "semver-parser",
+]
+
+[[package]]
+name = "semver"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "394cec28fa623e00903caf7ba4fa6fb9a0e260280bb8cdbbba029611108a0190"
+dependencies = [
+ "semver-parser",
+ "serde",
+]
+
+[[package]]
+name = "semver-parser"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
+
+[[package]]
+name = "serde"
+version = "1.0.118"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.118"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.61"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a"
+dependencies = [
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "strsim"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
+
+[[package]]
+name = "syn"
+version = "1.0.57"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4211ce9909eb971f111059df92c45640aad50a619cf55cd76476be803c4c68e6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-xid",
+]
+
+[[package]]
+name = "synstructure"
+version = "0.12.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+ "unicode-xid",
+]
+
+[[package]]
+name = "textwrap"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
+dependencies = [
+ "unicode-width",
+]
+
+[[package]]
+name = "thread_local"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
+dependencies = [
+ "lazy_static",
+]
+
+[[package]]
+name = "toml"
+version = "0.5.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "unicode-width"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
+
+[[package]]
+name = "unicode-xid"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
+
+[[package]]
+name = "vec_map"
+version = "0.8.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-binutils/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-binutils/default.nix
new file mode 100644
index 000000000000..f499512ce532
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-binutils/default.nix
@@ -0,0 +1,34 @@
+{ lib, fetchFromGitHub, rustPlatform, runCommand }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-binutils";
+  version = "0.3.3";
+
+  # Upstream doesn't commit `Cargo.lock`, see https://github.com/rust-embedded/cargo-binutils/pull/99
+  src =
+    let
+      repo = fetchFromGitHub {
+        owner = "rust-embedded";
+        repo = pname;
+        rev = "v${version}";
+        sha256 = "sha256-Dgn+f4aSsDSh+RC8yvt3ydkdtwib5jEVsnZkod5c7Vo=";
+      };
+    in
+    runCommand "source" { } ''
+      cp -R ${repo} $out
+      chmod -R +w $out
+      cp ${./Cargo.lock} $out/Cargo.lock
+    '';
+
+  cargoSha256 = "sha256-6du86HxkDQAeIXScXBKuv0j4YZiG4O6IwVIXZnJgTO8=";
+
+  meta = with lib; {
+    description = "Cargo subcommands to invoke the LLVM tools shipped with the Rust toolchain.";
+    longDescription = ''
+      In order for this to work, you either need to run `rustup component add llvm-tools-preview` or install the `llvm-tools-preview` component using your Nix library (e.g. nixpkgs-mozilla, or rust-overlay)
+    '';
+    homepage = "https://github.com/rust-embedded/cargo-binutils";
+    license = with licenses; [ asl20 mit ];
+    maintainers = with maintainers; [ stupremee ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-bisect-rustc/0001-dynamically-patchelf-binaries.patch b/nixpkgs/pkgs/development/tools/rust/cargo-bisect-rustc/0001-dynamically-patchelf-binaries.patch
new file mode 100644
index 000000000000..6a4967e96054
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-bisect-rustc/0001-dynamically-patchelf-binaries.patch
@@ -0,0 +1,56 @@
+diff --git a/src/toolchains.rs b/src/toolchains.rs
+index 4d85e7c..b1353c6 100644
+--- a/src/toolchains.rs
++++ b/src/toolchains.rs
+@@ -259,6 +259,8 @@ impl Toolchain {
+             .map_err(InstallError::Download)?;
+         }
+
++        nix_patchelf(tmpdir.path().to_path_buf())
++            .expect("failed to patch toolchain for NixOS");
+         fs::rename(tmpdir.into_path(), dest).map_err(InstallError::Move)?;
+
+         Ok(())
+@@ -557,3 +559,42 @@ pub(crate) fn download_tarball(
+     }
+     download_tar_gz(client, name, &format!("{}.gz", url,), strip_prefix, dest)
+ }
++
++fn nix_patchelf(mut toolchain_path: PathBuf) -> Result<(), Error> {
++    toolchain_path.push("bin");
++
++    for entry in toolchain_path.read_dir()? {
++        let entry = entry?;
++        if !entry.file_type()?.is_file() {
++            continue;
++        }
++
++        eprintln!("info: you seem to be running NixOS. Attempting to patch {}",
++                  entry.path().to_str().unwrap());
++        let _ = ::std::process::Command::new("@patchelf@/bin/patchelf")
++            .arg("--set-interpreter")
++            .arg("@dynamicLinker@")
++            .arg(entry.path())
++            .output();
++    }
++
++    toolchain_path.pop();
++    toolchain_path.push("lib");
++
++    for entry in toolchain_path.read_dir()? {
++        let entry = entry?;
++        if !entry.file_type()?.is_file() {
++            continue;
++        }
++
++        eprintln!("info: you seem to be running NixOS. Attempting to patch {}",
++                  entry.path().to_str().unwrap());
++        let _ = ::std::process::Command::new("@patchelf@/bin/patchelf")
++            .arg("--set-rpath")
++            .arg("@libPath@")
++            .arg(entry.path())
++            .output();
++    }
++
++    Ok(())
++}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-bisect-rustc/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-bisect-rustc/default.nix
new file mode 100644
index 000000000000..7eef0ce66299
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-bisect-rustc/default.nix
@@ -0,0 +1,56 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, rustPlatform
+, pkg-config
+, openssl
+, runCommand
+, patchelf
+, zlib
+, Security
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-bisect-rustc";
+  version = "0.6.0";
+
+  src = fetchFromGitHub {
+    owner = "rust-lang";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-LEmILWVU6hbh2FmdnQVV1Ob2MQvj+/lCr1hdRoTIOkI=";
+  };
+
+  patches =
+    let
+      patchelfPatch = runCommand "0001-dynamically-patchelf-binaries.patch" {
+        CC = stdenv.cc;
+        patchelf = patchelf;
+        libPath = "$ORIGIN/../lib:${lib.makeLibraryPath [ zlib ]}";
+      }
+      ''
+        export dynamicLinker=$(cat $CC/nix-support/dynamic-linker)
+        substitute ${./0001-dynamically-patchelf-binaries.patch} $out \
+          --subst-var patchelf \
+          --subst-var dynamicLinker \
+          --subst-var libPath
+      '';
+    in
+    lib.optionals stdenv.isLinux [ patchelfPatch ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    openssl
+  ] ++ lib.optionals stdenv.isDarwin [
+    Security
+  ];
+
+  cargoSha256 = "Ls51DQ0yScRhpkuEInCfR45+/WeaUoG935w4BJvwSRk=";
+
+  meta = with lib; {
+    description = "Bisects rustc, either nightlies or CI artifacts";
+    homepage = "https://github.com/rust-lang/${pname}";
+    license = with licenses; [ asl20 mit ];
+    maintainers = with maintainers; [ davidtwco ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-bitbake/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-bitbake/default.nix
new file mode 100644
index 000000000000..ee29976eb985
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-bitbake/default.nix
@@ -0,0 +1,26 @@
+{ lib, pkg-config, rustPlatform, fetchFromGitHub, openssl }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-bitbake";
+  version = "0.3.15";
+
+  src = fetchFromGitHub {
+    owner = "meta-rust";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1ffjkwaqvmyz374azrv6gna19z2fcg82is2k2n2gm50isbxw2aa5";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ openssl ];
+
+  cargoSha256 = "0mm6059wjh5p8923dwz55dpwi55gq2bcmpx7kn40pq5ppkiqjiw9";
+
+  meta = with lib; {
+    description = "Cargo extension that can generate BitBake recipes utilizing the classes from meta-rust";
+    homepage = "https://github.com/meta-rust/cargo-bitbake";
+    license = with licenses; [ mit asl20 ];
+    maintainers = with maintainers; [ rvarago ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-bloat/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-bloat/default.nix
new file mode 100644
index 000000000000..549c3d11e3ac
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-bloat/default.nix
@@ -0,0 +1,24 @@
+{ lib, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-bloat";
+  version = "0.10.1";
+
+  src = fetchFromGitHub {
+    owner = "RazrFalcon";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-VcdZ/dKqFFQs8ItNEj407z1pWJqpHwwIsuNnsQ8KU/8=";
+  };
+
+  cargoSha256 = "sha256-1TIGv0yVhkhThqZiQW9JrvFd0eouTlr8kgN/g7b4vDM=";
+
+  meta = with lib; {
+    description = "A tool and Cargo subcommand that helps you find out what takes most of the space in your executable";
+    homepage = "https://github.com/RazrFalcon/cargo-bloat";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ xrelkd ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-c/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-c/default.nix
new file mode 100644
index 000000000000..8b4780d7ea08
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-c/default.nix
@@ -0,0 +1,61 @@
+{ rustPlatform, stdenv, lib, fetchFromGitHub, fetchurl
+, pkg-config, curl, openssl
+, CoreFoundation, libiconv, Security
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-c";
+  version = "0.9.2";
+
+  src = stdenv.mkDerivation rec {
+    name = "${pname}-source-${version}";
+
+    src = fetchFromGitHub {
+      owner = "lu-zero";
+      repo = pname;
+      rev = "v${version}";
+      sha256 = "0hvlrhmbplx4cj4l5fynihgr9cdh0rkpwvipizk1gpp6p1ksr5hz";
+    };
+    cargoLock = fetchurl {
+      url = "https://github.com/lu-zero/${pname}/releases/download/v${version}/Cargo.lock";
+      sha256 = "0ckn31asz7013206j153ig96602dxvxm6skdz1plan0h05j5mgah";
+    };
+
+    installPhase = ''
+      mkdir -p $out
+      cp -R ./* $out/
+      cp ${cargoLock} $out/Cargo.lock
+    '';
+  };
+
+  cargoSha256 = "0c0vn2pcy5px02mc0l4a3w7z9n8hc6br5w3ww6nrav5w6911jp52";
+
+
+  nativeBuildInputs = [ pkg-config (lib.getDev curl) ];
+  buildInputs = [ openssl curl ]
+  ++ lib.optionals stdenv.isDarwin [ CoreFoundation libiconv Security ];
+
+  # Ensure that we are avoiding build of the curl vendored in curl-sys
+  doInstallCheck = stdenv.hostPlatform.libc == "glibc";
+  installCheckPhase = ''
+    runHook preInstallCheck
+
+    ldd "$out/bin/cargo-cbuild" | grep libcurl.so
+
+    runHook postInstallCheck
+  '';
+
+  meta = with lib; {
+    description = "A cargo subcommand to build and install C-ABI compatibile dynamic and static libraries";
+    longDescription = ''
+      Cargo C-ABI helpers. A cargo applet that produces and installs a correct
+      pkg-config file, a static library and a dynamic library, and a C header
+      to be used by any C (and C-compatible) software.
+    '';
+    homepage = "https://github.com/lu-zero/cargo-c";
+    changelog = "https://github.com/lu-zero/cargo-c/releases/tag/v${version}";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-cache/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-cache/default.nix
new file mode 100644
index 000000000000..12d9bd6bb036
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-cache/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, rustPlatform, libiconv, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-cache";
+  version = "0.6.3";
+
+  src = fetchFromGitHub {
+    owner = "matthiaskrgr";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-y6rvdY9511XScxLWPrH9aUFgSmRYmGqKE56MPBTH9OM=";
+  };
+
+  cargoSha256 = "sha256-H6MBAXrKu4hZwx3lGHN6YMuYzeb21Zq0tVlF/lsQmLI=";
+
+  buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security ];
+
+  checkFlagsArray = [ "offline_tests" ];
+
+  meta = with lib; {
+    description = "Manage cargo cache (\${CARGO_HOME}, ~/.cargo/), print sizes of dirs and remove dirs selectively";
+    homepage = "https://github.com/matthiaskrgr/cargo-cache";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ Br1ght0ne ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-crev/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-crev/default.nix
new file mode 100644
index 000000000000..9803cd531e7e
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-crev/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv
+, fetchFromGitHub
+, rustPlatform
+, perl
+, pkg-config
+, SystemConfiguration
+, Security
+, curl
+, libiconv
+, openssl
+, git
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-crev";
+  version = "0.20.1";
+
+  src = fetchFromGitHub {
+    owner = "crev-dev";
+    repo = "cargo-crev";
+    rev = version;
+    sha256 = "sha256-j2dafXUI6rDEYboSAciMeNma/YaBYKuQZgMUGVU+oBQ=";
+  };
+
+  cargoSha256 = "sha256-khrpS6QFpweKbTbR0YhAJTTrgDoZl9fzYPDs+JE1mtA=";
+
+  preCheck = ''
+    export HOME=$(mktemp -d)
+    git config --global user.name "Nixpkgs Test"
+    git config --global user.email "nobody@example.com"
+  '';
+
+  nativeBuildInputs = [ perl pkg-config ];
+
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ SystemConfiguration Security libiconv curl ];
+
+  checkInputs = [ git ];
+
+  meta = with lib; {
+    description = "A cryptographically verifiable code review system for the cargo (Rust) package manager";
+    homepage = "https://github.com/crev-dev/cargo-crev";
+    license = with licenses; [ asl20 mit mpl20 ];
+    maintainers = with maintainers; [ b4dm4n ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-criterion/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-criterion/default.nix
new file mode 100644
index 000000000000..d33f455c9b93
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-criterion/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchFromGitHub, rustPlatform }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-criterion";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "bheisler";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-RPix9DM6E32PhObvV3xPGrnXrrVHn3auxLUhysP8GM0=";
+  };
+
+  cargoSha256 = "sha256-L/ILHKWlcYTkbEi2qDu7tf/3NHfTl6GhW0s+fUlsW08=";
+
+  meta = with lib; {
+    description = "Cargo extension for running Criterion.rs benchmarks";
+    homepage = "https://github.com/bheisler/cargo-criterion";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ humancalico ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-cross/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-cross/default.nix
new file mode 100644
index 000000000000..ff76a755cddc
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-cross/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, fetchpatch
+, nix-update-script
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-cross";
+  version = "0.2.1";
+
+  src = fetchFromGitHub {
+    owner = "rust-embedded";
+    repo = "cross";
+    rev = "v${version}";
+    sha256 = "1py5w4kf612x4qxi190ilsrx0zzwdzk9i47ppvqblska1s47qa2w";
+  };
+
+  cargoSha256 = "sha256-zk6cbN4iSHnyoeWupufVf2yQK6aq3S99uk9lqpjCw4c=";
+
+  cargoPatches = [
+    (fetchpatch {
+      url = "https://github.com/rust-embedded/cross/commit/e86ad2e5a55218395df7eaaf91900e22b809083c.patch";
+      sha256 = "1zrcj5fm3irmlrfkgb65kp2pjkry0rg5nn9pwsk9p0i6dpapjc7k";
+    })
+  ];
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = "Zero setup cross compilation and cross testing";
+    homepage = "https://github.com/rust-embedded/cross";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ otavio ];
+    mainProgram = "cross";
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-deadlinks/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-deadlinks/default.nix
new file mode 100644
index 000000000000..ebd66a9b0093
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-deadlinks/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, rustPlatform, fetchFromGitHub, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-deadlinks";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "deadlinks";
+    repo = pname;
+    rev = "${version}";
+    sha256 = "1zd5zgq3346xijllr0qdvvmsilpawisrqgdmsqir8v3bk55ybj4g";
+  };
+
+  cargoSha256 = "1ar3iwpy9mng4j09z4g3ynxra2qwc8454dnc0wjal4h16fk8gxwv";
+
+  checkFlags = [
+    # uses internet
+    "--skip non_existent_http_link --skip working_http_check"
+    # expects top-level directory to be named "cargo-deadlinks"
+    "--skip simple_project::it_checks_okay_project_correctly"
+  ];
+
+  buildInputs = lib.optional stdenv.isDarwin Security;
+
+  meta = with lib; {
+    description = "Cargo subcommand to check rust documentation for broken links";
+    homepage = "https://github.com/deadlinks/cargo-deadlinks";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ newam ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-deny/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-deny/default.nix
new file mode 100644
index 000000000000..955df96b2284
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-deny/default.nix
@@ -0,0 +1,36 @@
+{ stdenv
+, lib
+, rustPlatform
+, fetchFromGitHub
+, perl, pkg-config, openssl, Security, libiconv, curl
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-deny";
+  version = "0.9.1";
+
+  src = fetchFromGitHub {
+    owner = "EmbarkStudios";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-v7Gdemn0IeO6lOg/kT6VKuL5ZSOqA9A721Wv5QStO2Q=";
+  };
+
+  cargoSha256 = "sha256-SF7LfxmUMX7f+9BmYTzdjTFplXj5j0e181yRVTIEGH4=";
+
+  doCheck = false;
+
+  nativeBuildInputs = [ perl pkg-config ];
+
+  buildInputs = [ openssl  ]
+    ++ lib.optionals stdenv.isDarwin [ Security libiconv curl ];
+
+  meta = with lib; {
+    description = "Cargo plugin to generate list of all licenses for a crate";
+    homepage = "https://github.com/EmbarkStudios/cargo-deny";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ matthiasbeyer ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-dephell/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-dephell/default.nix
new file mode 100644
index 000000000000..0fe9a0605401
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-dephell/default.nix
@@ -0,0 +1,26 @@
+{ lib, rustPlatform, fetchFromGitHub, pkg-config, openssl, stdenv, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-dephell";
+  version = "0.5.1";
+
+  src = fetchFromGitHub {
+    owner = "mimoo";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1v3psrkjhgbkq9lm3698ac77qgk090jbly4r187nryj0vcmf9s1l";
+  };
+
+  cargoSha256 = "0fwj782dbyj3ps16hxmq61drf8714863jb0d3mhivn3zlqawyyil";
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ openssl ] ++ lib.optional stdenv.isDarwin Security;
+
+  meta = with lib; {
+    description = "A tool to analyze the third-party dependencies imported by a rust crate or rust workspace";
+    homepage = "https://github.com/mimoo/cargo-dephell";
+    license = with licenses; [ mit /* or */ asl20 ];
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-diet/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-diet/default.nix
new file mode 100644
index 000000000000..df50ed02d11a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-diet/default.nix
@@ -0,0 +1,23 @@
+{ lib, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-diet";
+  version = "1.2.2";
+
+  src = fetchFromGitHub {
+    owner = "the-lean-crate";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1wxwf3i8qhak8b61iscsbndm4z7r5sg6iiarqlpf0y3lzb0yi5ah";
+  };
+
+  cargoSha256 = "06scamzr1676q5lx75bm05hdr21mdiby84dpm1wf2va5qpq6mjyl";
+
+  meta = with lib; {
+    description = "Help computing optimal include directives for your Cargo.toml manifest";
+    homepage = "https://github.com/the-lean-crate/cargo-diet";
+    changelog = "https://github.com/the-lean-crate/cargo-diet/blob/v${version}/CHANGELOG.md";
+    license = licenses.mit;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-embed/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-embed/default.nix
new file mode 100644
index 000000000000..2af012956c1a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-embed/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, stdenv
+, rustPlatform
+, fetchFromGitHub
+, libusb1
+, libftdi1
+, pkg-config
+, rustfmt
+, AppKit
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-embed";
+  version = "0.11.0";
+
+  src = fetchFromGitHub {
+    owner = "probe-rs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "151zdnv4i0dgkk4w3j2a1sdklcxw07bgqjs7sv6lvkylrx8dfrxa";
+  };
+
+  cargoSha256 = "00p2rwqrax99kwadc8bfq8pbcijals2nzpx43wb03kwxl4955wn9";
+
+  nativeBuildInputs = [ pkg-config rustfmt ];
+  buildInputs = [ libusb1 libftdi1 ] ++ lib.optionals stdenv.isDarwin [ AppKit ];
+
+  cargoBuildFlags = [ "--features=ftdi" ];
+
+  meta = with lib; {
+    description = "A cargo extension for working with microcontrollers";
+    homepage = "https://probe.rs/";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ fooker ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-expand/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-expand/default.nix
new file mode 100644
index 000000000000..304ede5214ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-expand/default.nix
@@ -0,0 +1,25 @@
+{ lib, rustPlatform, fetchFromGitHub, stdenv, libiconv }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-expand";
+  version = "1.0.9";
+
+  src = fetchFromGitHub {
+    owner = "dtolnay";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-wDuCmiQzyY/Ydr67fYb0yZaSWvuYwW91j0CoqbUFFpg=";
+  };
+
+  cargoSha256 = "sha256-5KCGXJzk5VStby/JzjXJvDSrhFlB8YJHMcQNL8GxkLI=";
+
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
+
+  meta = with lib; {
+    description =
+      "A utility and Cargo subcommand designed to let people expand macros in their Rust source code";
+    homepage = "https://github.com/dtolnay/cargo-expand";
+    license = with licenses; [ mit asl20 ];
+    maintainers = with maintainers; [ xrelkd ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-feature/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-feature/default.nix
new file mode 100644
index 000000000000..0f21e4326f3a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-feature/default.nix
@@ -0,0 +1,26 @@
+{ lib, rustPlatform, fetchFromGitHub, stdenv, libiconv }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-feature";
+  version = "0.5.3";
+
+  src = fetchFromGitHub {
+    owner = "Riey";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-aUzmD5Dt0obXWDdZT6/Bzun2R1TLQYYELrN4xEG4hq8=";
+  };
+
+  cargoSha256 = "sha256-R8OaxlBAkK5YQPejOdLuCMeQlCbPcC/VQm9WHm31v54=";
+
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
+
+  meta = with lib; {
+    description = "Allows conveniently modify features of crate";
+    homepage = "https://github.com/Riey/cargo-feature";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ riey ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-flash/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-flash/default.nix
new file mode 100644
index 000000000000..13339e4dc342
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-flash/default.nix
@@ -0,0 +1,35 @@
+{ lib
+, stdenv
+, rustPlatform
+, fetchFromGitHub
+, libusb1
+, openssl
+, pkg-config
+, rustfmt
+, Security
+, AppKit
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-flash";
+  version = "0.11.0";
+
+  src = fetchFromGitHub {
+    owner = "probe-rs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-yTtnRdDy3wGBe0SlO0165uooWu6ZMhUQw3hdDUK1e8A=";
+  };
+
+  cargoSha256 = "sha256-f5vUMdyz3vDh2yE0pMKZiknsqTAKkuvTCtlgb6/gaLc=";
+
+  nativeBuildInputs = [ pkg-config rustfmt ];
+  buildInputs = [ libusb1 openssl ] ++ lib.optionals stdenv.isDarwin [ Security AppKit ];
+
+  meta = with lib; {
+    description = "A cargo extension for working with microcontrollers";
+    homepage = "https://probe.rs/";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ fooker ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-fund/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-fund/default.nix
new file mode 100644
index 000000000000..43655fd6a89e
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-fund/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, rustPlatform, Security, curl, openssl, libiconv }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-fund";
+  version = "0.2.0";
+
+  src = fetchFromGitHub {
+    owner = "acfoltzer";
+    repo = pname;
+    rev = version;
+    sha256 = "1jim5bgq3fc33391qpa1q1csbzqf4hk1qyfzwxpcs5pb4ixb6vgk";
+  };
+
+  cargoSha256 = "1c2zryxn1bbg3ksp8azk9xmwfgwr6663hlmdv9c358hzqdfp9hli";
+
+  # The tests need a GitHub API token.
+  doCheck = false;
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security libiconv curl ];
+
+  meta = with lib; {
+    description = "Discover funding links for your project's dependencies";
+    homepage = "https://github.com/acfoltzer/cargo-fund";
+    license = with licenses; [ mit /* or */ asl20 ];
+    maintainers = with maintainers; [ johntitor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-fuzz/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-fuzz/default.nix
new file mode 100644
index 000000000000..56a2962f0c92
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-fuzz/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, rustPlatform, stdenv, libiconv }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-fuzz";
+  version = "0.10.1";
+
+  src = fetchFromGitHub {
+    owner = "rust-fuzz";
+    repo = "cargo-fuzz";
+    rev = version;
+    sha256 = "sha256-txlHXboQi3Z8AMIJJBZsBrCA7xggF0zGDpKqcD8UxMo=";
+  };
+
+  cargoSha256 = "sha256-eEfry6Q2YiIkNEHu6C8p17pUTF43eS1/iTP2oATZ/F8=";
+
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Command line helpers for fuzzing";
+    homepage = "https://github.com/rust-fuzz/cargo-fuzz";
+    license = with licenses; [ mit asl20 ];
+    maintainers = [ maintainers.ekleog ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-geiger/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-geiger/default.nix
new file mode 100644
index 000000000000..bd71a14b4a04
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-geiger/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib, fetchFromGitHub
+, rustPlatform, pkg-config, openssl
+# testing packages
+, cargo-insta
+# darwin dependencies
+, Security, CoreFoundation, libiconv
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-geiger";
+  version = "0.10.2";
+
+  src = fetchFromGitHub {
+    owner = "rust-secure-code";
+    repo = pname;
+    rev = "${pname}-${version}";
+    sha256 = "1z920p8i3gkjadyd6bqjk4i5yr5ds3m3sbcnf7plcqr69dsjr4b8";
+  };
+
+  cargoSha256 = "1wf9758gyaxgyajjzy5phirg922n9wv0qmy67zjmxj56ayf0l9lm";
+
+  checkPhase = ''
+    ${cargo-insta}/bin/cargo-insta test
+  '';
+
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security libiconv ];
+  nativeBuildInputs = [ pkg-config ];
+
+  # FIXME: Use impure version of CoreFoundation because of missing symbols.
+  # CFURLSetResourcePropertyForKey is defined in the headers but there's no
+  # corresponding implementation in the sources from opensource.apple.com.
+  preConfigure = lib.optionalString stdenv.isDarwin ''
+    export NIX_CFLAGS_COMPILE="-F${CoreFoundation}/Library/Frameworks $NIX_CFLAGS_COMPILE"
+  '';
+
+  meta = with lib; {
+    description = "Detects usage of unsafe Rust in a Rust crate and its dependencies";
+    homepage = "https://github.com/rust-secure-code/cargo-geiger";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ evanjs ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-geiger/update-cargo-lock.sh b/nixpkgs/pkgs/development/tools/rust/cargo-geiger/update-cargo-lock.sh
new file mode 100755
index 000000000000..6e077c6733f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-geiger/update-cargo-lock.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# This updates cargo-lock.patch for the diesel version listed in default.nix.
+
+set -eu -o verbose
+
+here=$PWD
+version=$(cat default.nix | grep '^  version = "' | cut -d '"' -f 2)
+checkout=$(mktemp -d)
+git clone -b "cargo-geiger-$version" --depth=1 https://github.com/rust-secure-code/cargo-geiger "$checkout"
+cd "$checkout"
+
+rm -f rust-toolchain
+cargo generate-lockfile
+git add -f Cargo.lock
+git diff HEAD -- Cargo.lock > "$here"/cargo-lock.patch
+
+cd "$here"
+rm -rf "$checkout"
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-generate/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-generate/default.nix
new file mode 100644
index 000000000000..040109da3adb
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-generate/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, rustPlatform, Security, openssl, pkg-config, libiconv, curl }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-generate";
+  version = "0.5.3";
+
+  src = fetchFromGitHub {
+    owner = "ashleygwilliams";
+    repo = "cargo-generate";
+    rev = "v${version}";
+    sha256 = "sha256-RrDwq5VufMDsPlqRmBP3x2RUWU740L0L18noByO1IDY=";
+  };
+
+  cargoSha256 = "sha256-/0pxEQFhovPRI4Knv5xq6+PHRuGN6+tF8CdK5X30LKI=";
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ openssl  ]
+    ++ lib.optionals stdenv.isDarwin [ Security libiconv curl ];
+
+  preCheck = ''
+    export HOME=$(mktemp -d) USER=nixbld
+    git config --global user.name Nixbld
+    git config --global user.email nixbld@localhost.localnet
+  '';
+
+  meta = with lib; {
+    description = "cargo, make me a project";
+    homepage = "https://github.com/ashleygwilliams/cargo-generate";
+    license = licenses.asl20;
+    maintainers = [ maintainers.turbomack ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-inspect/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-inspect/default.nix
new file mode 100644
index 000000000000..1644929074bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-inspect/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, lib, rustPlatform, fetchFromGitHub, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-inspect";
+  version = "0.10.3";
+
+  src = fetchFromGitHub {
+    owner = "mre";
+    repo = pname;
+    rev = version;
+    sha256 = "026vc8d0jkc1d7dlp3ldmwks7svpvqzl0k5niri8a12cl5w5b9hj";
+  };
+
+  buildInputs = lib.optionals stdenv.isDarwin [ Security ];
+
+  cargoSha256 = "069i8ydrp1pssnjq7d6mydwr7xh2cmcpzpf8bzd6nfjr6xx1pipr";
+
+  meta = with lib; {
+    description = "See what Rust is doing behind the curtains";
+    homepage = "https://github.com/mre/cargo-inspect";
+    license = with licenses; [ mit asl20 ];
+    maintainers = with maintainers; [ minijackson ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-insta/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-insta/default.nix
new file mode 100644
index 000000000000..0c3773933545
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-insta/default.nix
@@ -0,0 +1,24 @@
+{ lib, rustPlatform, fetchFromGitHub, libiconv, stdenv }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-insta";
+  version = "1.7.1";
+
+  src = fetchFromGitHub {
+    owner = "mitsuhiko";
+    repo = "insta";
+    rev = version;
+    sha256 = "1qzzkhailxjqwp3rmdcpp112wn3x0gfi788vwj77pfdyclhpj0a7";
+  };
+
+  sourceRoot = "source/cargo-insta";
+  cargoSha256 = "01fj2j7ibrk5dyrfkmc610lh1p6f6bgzbgivq3dsd64vslhqmabw";
+  buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
+
+  meta = with lib; {
+    description = "A Cargo subcommand for snapshot testing";
+    homepage = "https://github.com/mitsuhiko/insta";
+    license = licenses.asl20;
+    maintainers = with lib.maintainers; [ oxalica ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-limit/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-limit/default.nix
new file mode 100644
index 000000000000..76f766685ab4
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-limit/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, nix-update-script
+, stdenv
+, libiconv
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-limit";
+  version = "0.0.8";
+
+  src = fetchFromGitHub {
+    owner = "alopatindev";
+    repo = "cargo-limit";
+    rev = version;
+    sha256 = "sha256-OHBxQcXhZkJ1F6xLc7/sPpJhJzuJXb91IUjAtyC3XP8=";
+  };
+
+  cargoSha256 = "sha256-LxqxRtMKUKZeuvk1caoYy8rv1bkEOQBM8i5SXMF4GXc=";
+
+  buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = "Cargo subcommand \"limit\": reduces the noise of compiler messages";
+    homepage = "https://github.com/alopatindev/cargo-limit";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ otavio ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-llvm-lines/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-llvm-lines/default.nix
new file mode 100644
index 000000000000..1e10d9eddcf0
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-llvm-lines/default.nix
@@ -0,0 +1,22 @@
+{ lib, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-llvm-lines";
+  version = "0.4.12";
+
+  src = fetchFromGitHub {
+    owner = "dtolnay";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-D4blt8kGD0mxysedRMZo/VNfwfYdJs8T2zoNjHRi0ng=";
+  };
+
+  cargoSha256 = "sha256-H2APBu9oHmtRGSB+VQT9V5C36awPy8fi6A2Qf1RsIbU=";
+
+  meta = with lib; {
+    description = "Count the number of lines of LLVM IR across all instantiations of a generic function";
+    homepage = "https://github.com/dtolnay/cargo-llvm-lines";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-make/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-make/default.nix
new file mode 100644
index 000000000000..01173474db6f
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-make/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, stdenv
+, fetchurl
+, runCommand
+, fetchCrate
+, rustPlatform
+, Security
+, openssl
+, pkg-config
+, SystemConfiguration
+, libiconv
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-make";
+  version = "0.35.0";
+
+  src = fetchCrate {
+    inherit pname version;
+    sha256 = "sha256-pC3iX5jAPBArxs+YECDyUW5+MP+/f2HMLZNjo+BoKOE=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ openssl ]
+    ++ lib.optionals stdenv.isDarwin [ Security SystemConfiguration libiconv ];
+
+  cargoSha256 = "sha256-Zp2LoeCnpYupi/QY3Ft1VQ+O/y3I96UaouEFs9QpbLg=";
+
+  # Some tests fail because they need network access.
+  # However, Travis ensures a proper build.
+  # See also:
+  #   https://travis-ci.org/sagiegurari/cargo-make
+  doCheck = false;
+
+  meta = with lib; {
+    description = "A Rust task runner and build tool";
+    homepage = "https://github.com/sagiegurari/cargo-make";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ xrelkd ma27 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-modules/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-modules/default.nix
new file mode 100644
index 000000000000..f894915c24ec
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-modules/default.nix
@@ -0,0 +1,22 @@
+{ lib, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-modules";
+  version = "0.5.0";
+
+  src = fetchFromGitHub {
+    owner = "regexident";
+    repo = pname;
+    rev = version;
+    sha256 = "0y6ag8nar85l2fh2ca41fglkzc74cv1p5szxrhk1jdqnd2qzhvjp";
+  };
+
+  cargoSha256 = "0m5r36p57w4vw2g3hg12s38ay328swjb0qfl381xwb2xqx10g8kx";
+
+  meta = with lib; {
+    description = "A cargo plugin for showing a tree-like overview of a crate's modules";
+    homepage = "https://github.com/regexident/cargo-modules";
+    license = with licenses; [ mpl20 ];
+    maintainers = with maintainers; [ rvarago ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-msrv/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-msrv/default.nix
new file mode 100644
index 000000000000..96720a549a90
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-msrv/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, nix-update-script
+, pkg-config
+, openssl
+, stdenv
+, libiconv
+, Security
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-msrv";
+  version = "0.9.0";
+
+  src = fetchFromGitHub {
+    owner = "foresterre";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-QN9N3o6gnr/pUTvRHxl3Wv42KxFOlRDpIr5pw2vB1x4=";
+  };
+
+  cargoSha256 = "sha256-rgiOwkbQLnaREvd5yMmipnVnl5Lqb+g+SHeP0V8XVTQ=";
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  # Integration tests fail
+  doCheck = false;
+
+  buildInputs = if stdenv.isDarwin
+    then [ libiconv Security ]
+    else [ openssl ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    description = "Cargo subcommand \"msrv\": assists with finding your minimum supported Rust version (MSRV)";
+    homepage = "https://github.com/foresterre/cargo-msrv";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ otavio ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-play/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-play/default.nix
new file mode 100644
index 000000000000..a4937ee412b8
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-play/default.nix
@@ -0,0 +1,28 @@
+{ lib, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-play";
+  version = "0.5.0";
+
+  src = fetchFromGitHub {
+    owner = "fanzeyi";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "01r00akfmvpzp924yqqybd9s0pwiwxy8vklsg4m9ypzljc3nlv02";
+  };
+
+  cargoSha256 = "1xkscd9ci9vlkmbsaxvavrna1xpi16xcf9ri879lw8bdh7sa3nx8";
+
+  # these tests require internet access
+  checkFlags = [
+    "--skip=dtoa_test"
+    "--skip=infer_override"
+  ];
+
+  meta = with lib; {
+    description = "Run your rust code without setting up cargo";
+    homepage = "https://github.com/fanzeyi/cargo-play";
+    license = licenses.mit;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-raze/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-raze/default.nix
new file mode 100644
index 000000000000..0299fe516d94
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-raze/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, rustPlatform
+, pkg-config, curl, libgit2, openssl, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-raze";
+  version = "0.12.0";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "161m4y6i4sgqi9mg3f3348f5cr0m45vhix4a4bcw54wnmhiklnnl";
+  };
+  sourceRoot = "source/impl";
+
+  cargoSha256 = "1vlywdq0bx6b1k3w1grisca0hvv2s4s88yxq7bil8nhm5ghjgxdr";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ curl libgit2 openssl ]
+    ++ lib.optional stdenv.isDarwin Security;
+
+  # thread 'main' panicked at 'Cannot ping mock server.: "cannot send request to mock server: cannot send request to mock server: failed to resolve host name"'
+  # __darwinAllowLocalNetworking does not fix the panic
+  doCheck = !stdenv.isDarwin;
+
+  meta = with lib; {
+    description = "Generate Bazel BUILD files from Cargo dependencies";
+    homepage = "https://github.com/google/cargo-raze";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ elasticdog ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-readme/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-readme/default.nix
new file mode 100644
index 000000000000..fb45763b50be
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-readme/default.nix
@@ -0,0 +1,34 @@
+{ lib, rustPlatform, fetchFromGitHub, fetchpatch }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-readme";
+  version = "3.2.0";
+
+  src = fetchFromGitHub {
+    owner = "livioribeiro";
+    repo = pname;
+    # Git tag is missing, see upstream issue:
+    # https://github.com/livioribeiro/cargo-readme/issues/61
+    rev = "cf66017c0120ae198210ebaf58a0be6a78372974";
+    sha256 = "sha256-/ufHHM13L83M3UYi6mjdhIjgXx7bZgzvR/X02Zsx7Fw=";
+  };
+
+  cargoSha256 = "sha256-Isd05qOuVBNfXOI5qsaDOhjF7QIKAG5xrZsBFK2PpQQ=";
+
+  patches = [
+    (fetchpatch {
+      # Fixup warning thrown at build when running test-suite
+      # unused return, see upstream PR:
+      # https://github.com/livioribeiro/cargo-readme/pull/62
+      url = "https://github.com/livioribeiro/cargo-readme/commit/060f2daaa2b2cf981bf490dc36bcc6527545ea03.patch";
+      sha256 = "sha256-wlAIgTI9OqtA/Jnswoqp7iOj+1zjrUZA7JpHUiF/n+s=";
+    })
+  ];
+
+  meta = with lib; {
+    description = "Generate README.md from docstrings";
+    homepage = "https://github.com/livioribeiro/cargo-readme";
+    license = with licenses; [ mit asl20 ];
+    maintainers = with maintainers; [ baloo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-rr/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-rr/default.nix
new file mode 100644
index 000000000000..47d58e9b92ac
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-rr/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, nix-update-script
+, makeWrapper
+, rr
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-rr";
+  version = "0.1.3";
+
+  src = fetchFromGitHub {
+    owner = "danielzfranklin";
+    repo = pname;
+    rev = version;
+    sha256 = "01m8fdz9as2fxnzs9csvbc76qxzbb98a66dh7w4a5q855v38g0zy";
+  };
+
+  cargoSha256 = "0fjs76n6bbbv83s213h2dgsszgxy4hbjsclyk9m81b3bfbmmb9sa";
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postInstall = ''
+    wrapProgram $out/bin/cargo-rr --prefix PATH : ${lib.makeBinPath [ rr ]}
+  '';
+
+  meta = with lib; {
+    description = "Cargo subcommand \"rr\": a light wrapper around rr, the time-travelling debugger";
+    homepage = "https://github.com/danielzfranklin/cargo-rr";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ otavio ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-sort/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-sort/default.nix
new file mode 100644
index 000000000000..9ab6d7e2b03a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-sort/default.nix
@@ -0,0 +1,22 @@
+{ fetchFromGitHub, lib, rustPlatform }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-sort";
+  version = "1.0.5";
+
+  src = fetchFromGitHub {
+    owner = "devinr528";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "146aawikyjcxbj0dpnqia31xmplpwkl9w1gv7d9a5jvz8whvxrff";
+  };
+
+  cargoSha256 = "0xm37f285vmd674k5j72pcjg6zpmxlf46d9vppi9s3qaw0hsslpf";
+
+  meta = with lib; {
+    description = "A tool to check that your Cargo.toml dependencies are sorted alphabetically";
+    homepage = "https://github.com/devinr528/cargo-sort";
+    license = with licenses; [ mit /* or */ asl20 ];
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-spellcheck/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-spellcheck/default.nix
new file mode 100644
index 000000000000..836b959f1023
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-spellcheck/default.nix
@@ -0,0 +1,32 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, libclang
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-spellcheck";
+  version = "0.8.13";
+
+  src = fetchFromGitHub {
+    owner = "drahnr";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0k88ma00gj8wjdvd7ysbbvqnf5sk1w8d3wqbi6qfxnqrc1k3hlv2";
+  };
+
+  cargoSha256 = "0mmk0igm2s8sxi65zvikxhz52xhkyd3ljqy61mij7zlx95rf639x";
+
+  LIBCLANG_PATH = "${libclang.lib}/lib";
+
+  checkFlags = [
+    "--skip checker::hunspell::tests::hunspell_binding_is_sane"
+  ];
+
+  meta = with lib; {
+    description = "Checks rust documentation for spelling and grammar mistakes";
+    homepage = "https://github.com/drahnr/cargo-spellcheck";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ newam ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-supply-chain/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-supply-chain/default.nix
new file mode 100644
index 000000000000..d5876f240a93
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-supply-chain/default.nix
@@ -0,0 +1,23 @@
+{ lib, rustPlatform, fetchCrate, stdenv, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-supply-chain";
+  version = "0.2.0";
+
+  src = fetchCrate {
+    inherit pname version;
+    sha256 = "sha256-zjDZJOUjnEQ03rmo5CdSY1emE6YohOPlf7SKuvNLuV0=";
+  };
+
+  cargoSha256 = "sha256-xSJ5rx8k+my0NeGYHZyvDzbM7uMdbViT7Ou9a9JACfs=";
+
+  buildInputs = lib.optional stdenv.isDarwin Security;
+
+  meta = with lib; {
+    description = "Gather author, contributor and publisher data on crates in your dependency graph";
+    homepage = "https://github.com/rust-secure-code/cargo-supply-chain";
+    changelog = "https://github.com/rust-secure-code/cargo-supply-chain/blob/master/CHANGELOG.md";
+    license = with licenses; [ asl20 mit zlib ]; # any of three
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-sweep/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-sweep/default.nix
new file mode 100644
index 000000000000..9efa337f1b19
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-sweep/default.nix
@@ -0,0 +1,22 @@
+{ lib, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-sweep";
+  version = "0.6.2";
+
+  src = fetchFromGitHub {
+    owner = "holmgr";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-tumcGnYqY/FGP8UWA0ccfdAK49LBcT8qH6SshrDXNAI=";
+  };
+
+  cargoSha256 = "sha256-fcosKyGOy0SKrHbsKdxQJimelt1ByAM4YKo7WpHV8CA=";
+
+  meta = with lib; {
+    description = "A Cargo subcommand for cleaning up unused build files generated by Cargo";
+    homepage = "https://github.com/holmgr/cargo-sweep";
+    license = licenses.mit;
+    maintainers = with maintainers; [ xrelkd ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-sync-readme/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-sync-readme/default.nix
new file mode 100644
index 000000000000..07c51c3163cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-sync-readme/default.nix
@@ -0,0 +1,22 @@
+{ lib, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-sync-readme";
+  version = "1.0";
+
+  src = fetchFromGitHub {
+    owner = "phaazon";
+    repo = pname;
+    rev = version;
+    sha256 = "1c38q87fyfmj6nlwdpavb1xxpi26ncywkgqcwbvblad15c6ydcyc";
+  };
+
+  cargoSha256 = "0vrbgs49ghhl4z4ljhghcs9fnbf7qx1an9kwbrgv9wng8m1dccah";
+
+  meta = with lib; {
+    description = "A cargo plugin that generates a Markdown section in your README based on your Rust documentation";
+    homepage = "https://github.com/phaazon/cargo-sync-readme";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ b4dm4n ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-tally/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-tally/default.nix
new file mode 100644
index 000000000000..21a5b470a2e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-tally/default.nix
@@ -0,0 +1,26 @@
+{ lib, rustPlatform, fetchCrate, stdenv, DiskArbitration, Foundation, IOKit }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-tally";
+  version = "1.0.0";
+
+  src = fetchCrate {
+    inherit pname version;
+    sha256 = "16r60ddrqsss5nagfb5g49md8wwm4zbp9sffbm23bhlqhxh35y0i";
+  };
+
+  cargoSha256 = "0ffq67vy0pa7va8j93g03bralz7lck6ds1hidbpzzkp13pdcgf97";
+
+  buildInputs = lib.optionals stdenv.isDarwin [
+    DiskArbitration
+    Foundation
+    IOKit
+  ];
+
+  meta = with lib; {
+    description = "Graph the number of crates that depend on your crate over time";
+    homepage = "https://github.com/dtolnay/cargo-tally";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-udeps/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-udeps/default.nix
new file mode 100644
index 000000000000..c08a714ce357
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-udeps/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, openssl, CoreServices, Security, libiconv, SystemConfiguration }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-udeps";
+  version = "0.1.23";
+
+  src = fetchFromGitHub {
+    owner = "est31";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-SDB2Xk2bEheXT0Lc1lrTkOyJAcAEsmUPU5R8Hy1SAUE=";
+  };
+
+  cargoSha256 = "sha256-gCGOXEjhT9bx3FYvtu3AoIOmgsU2WO1rmi/cKvD9WMY=";
+
+  nativeBuildInputs = [ pkg-config ];
+
+  # TODO figure out how to use provided curl instead of compiling curl from curl-sys
+  buildInputs = [ openssl ]
+    ++ lib.optionals stdenv.isDarwin [ CoreServices Security libiconv SystemConfiguration ];
+
+  # Requires network access
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Find unused dependencies in Cargo.toml";
+    homepage = "https://github.com/est31/cargo-udeps";
+    license = licenses.mit;
+    maintainers = with maintainers; [ b4dm4n ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-valgrind/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-valgrind/default.nix
new file mode 100644
index 000000000000..e1f26dc02b2e
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-valgrind/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, nix-update-script
+, makeWrapper
+, valgrind
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-valgrind";
+  version = "2.0.1";
+
+  src = fetchFromGitHub {
+    owner = "jfrimmel";
+    repo = "cargo-valgrind";
+    rev = version;
+    sha256 = "sha256-PltYUU2O/D1PrU+K8JN4+aUVLzHCeNyIsXMU6HLodXE=";
+  };
+
+  cargoSha256 = "sha256-XiQGkZ6pfyGkNPjpcPoY66qBl7ABTcRHCBjgmXSRrL0=";
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postInstall = ''
+    wrapProgram $out/bin/cargo-valgrind --prefix PATH : ${lib.makeBinPath [ valgrind ]}
+  '';
+
+  # Disable check phase as there are failures (2 tests fail)
+  doCheck = false;
+
+  meta = with lib; {
+    description = ''Cargo subcommand "valgrind": runs valgrind and collects its output in a helpful manner'';
+    homepage = "https://github.com/jfrimmel/cargo-valgrind";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ otavio ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-watch/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-watch/default.nix
new file mode 100644
index 000000000000..d349db0084c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-watch/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, rustPlatform, fetchFromGitHub, CoreServices, Foundation, rust, libiconv }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-watch";
+  version = "8.1.1";
+
+  src = fetchFromGitHub {
+    owner = "passcod";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-wv1aD20VHar0V7oKOEKIX3klGVXauMXU4vL+NgNeZPk=";
+  };
+
+  cargoSha256 = "sha256-qhCDrZAG1FcPYKMj2C/m+5Dplko4Tpp1hGpRdGOK/Ds=";
+
+  buildInputs = lib.optionals stdenv.isDarwin [ CoreServices Foundation libiconv ];
+
+  # `test with_cargo` tries to call cargo-watch as a cargo subcommand
+  # (calling cargo-watch with command `cargo watch`)
+  preCheck = ''
+    export PATH="$(pwd)/target/${rust.toRustTarget stdenv.hostPlatform}/release:$PATH"
+  '';
+
+  meta = with lib; {
+    description = "A Cargo subcommand for watching over Cargo project's source";
+    homepage = "https://github.com/passcod/cargo-watch";
+    license = licenses.cc0;
+    maintainers = with maintainers; [ xrelkd ivan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-whatfeatures/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-whatfeatures/default.nix
new file mode 100644
index 000000000000..7041f0ebd6cd
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-whatfeatures/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config, openssl, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-whatfeatures";
+  version = "0.9.6";
+
+  src = fetchFromGitHub {
+    owner = "museun";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0vki37pxngg15za9c1z61dc6sqk0j59s0qhcf9hplnym4ib5kqx1";
+  };
+
+  cargoSha256 = "sha256-ZEkSj/JzXXTHjaxBVS5RDk/ECvOPPjzH4eS3CmlQA9I=";
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ openssl ]
+    ++ lib.optionals stdenv.isDarwin [ Security ];
+
+  meta = with lib; {
+    description = "A simple cargo plugin to get a list of features for a specific crate";
+    homepage = "https://github.com/museun/cargo-whatfeatures";
+    license = with licenses; [ mit asl20 ];
+    maintainers = with maintainers; [ ivan-babrou ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-wipe/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-wipe/default.nix
new file mode 100644
index 000000000000..a59a124317b9
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-wipe/default.nix
@@ -0,0 +1,32 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, nix-update-script
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-wipe";
+  version = "0.3.1";
+
+  src = fetchFromGitHub {
+    owner = "mihai-dinculescu";
+    repo = "cargo-wipe";
+    rev = "v${version}";
+    sha256 = "sha256-sVekfGHg2wspP5/zJzXTXupspwJr4hQBucY5+8iUjUQ=";
+  };
+
+  cargoSha256 = "sha256-EoXgsWg1Rh7C+fIqvefkLdck4Yj3kox2ZAU3kn6nH8Q=";
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = ''Cargo subcommand "wipe": recursively finds and optionally wipes all "target" or "node_modules" folders'';
+    homepage = "https://github.com/mihai-dinculescu/cargo-wipe";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ otavio ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cargo-xbuild/default.nix b/nixpkgs/pkgs/development/tools/rust/cargo-xbuild/default.nix
new file mode 100644
index 000000000000..e8d62c9252f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cargo-xbuild/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchFromGitHub, rustPlatform }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-xbuild";
+  version = "0.6.2";
+
+  src = fetchFromGitHub {
+    owner = "rust-osdev";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "01whdjryz6zjsk4149h72w5xdjnkpcn5daf0xnsb59b0q38hjgg9";
+  };
+
+  cargoSha256 = "036a50shzl6wdjk5wypkacx1kjwbyb4x1aqhbzgjgpxxxrf0lj16";
+
+  meta = with lib; {
+    description = "Automatically cross-compiles the sysroot crates core, compiler_builtins, and alloc";
+    homepage = "https://github.com/rust-osdev/cargo-xbuild";
+    license = with licenses; [ mit asl20 ];
+    maintainers = with maintainers; [ johntitor xrelkd ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/cbindgen/default.nix b/nixpkgs/pkgs/development/tools/rust/cbindgen/default.nix
new file mode 100644
index 000000000000..69963ea7d1fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/cbindgen/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, rustPlatform, python3Packages, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "rust-cbindgen";
+  version = "0.20.0";
+
+  src = fetchFromGitHub {
+    owner = "eqrion";
+    repo = "cbindgen";
+    rev = "v${version}";
+    sha256 = "sha256-BLiAFYkqVJSpeNPW7UF2PpAttd6ADGeQ9yneiVfNi4g=";
+  };
+
+  cargoSha256 = "sha256-P58qANcl0mYqJDP1QnSx560y8BLH+ePTZ+uHuix89R4=";
+
+  buildInputs = lib.optional stdenv.isDarwin Security;
+
+  checkInputs = [
+    python3Packages.cython
+  ];
+
+  checkFlags = [
+    # Disable tests that require rust unstable features
+    # https://github.com/eqrion/cbindgen/issues/338
+    "--skip test_expand"
+    "--skip test_bitfield"
+    "--skip lib_default_uses_debug_build"
+    "--skip lib_explicit_debug_build"
+    "--skip lib_explicit_release_build"
+  ];
+
+  meta = with lib; {
+    description = "A project for generating C bindings from Rust code";
+    homepage = "https://github.com/eqrion/cbindgen";
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ jtojnar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/crate2nix/default.nix b/nixpkgs/pkgs/development/tools/rust/crate2nix/default.nix
new file mode 100644
index 000000000000..a86e531e7f67
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/crate2nix/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, makeWrapper
+
+, cargo
+, nix
+, nix-prefetch-git
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "crate2nix";
+  version = "0.10.0";
+
+  src = fetchFromGitHub {
+    owner = "kolloch";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-JaF9/H3m4Wrc5MtXcONkOAgKVkswLVw0yZe0dBr2e4Y=";
+  };
+
+  sourceRoot = "source/crate2nix";
+
+  cargoSha256 = "sha256-PD7R1vcb3FKd4hfpViKyvfCExJ5H1Xo2HPYden5zpxQ=";
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  # Tests use nix(1), which tries (and fails) to set up /nix/var inside the
+  # sandbox
+  doCheck = false;
+
+  postFixup = ''
+    wrapProgram $out/bin/crate2nix \
+        --suffix PATH ":" ${lib.makeBinPath [ cargo nix nix-prefetch-git ]}
+  '';
+
+  meta = with lib; {
+    description = "A Nix build file generator for Rust crates.";
+    longDescription = ''
+      Crate2nix generates Nix files from Cargo.toml/lock files
+      so that you can build every crate individually in a Nix sandbox.
+    '';
+    homepage = "https://github.com/kolloch/crate2nix";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ kolloch andir cole-h ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/maturin/default.nix b/nixpkgs/pkgs/development/tools/rust/maturin/default.nix
new file mode 100644
index 000000000000..3cbf9c404c68
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/maturin/default.nix
@@ -0,0 +1,49 @@
+{ callPackage
+, lib
+, stdenv
+, fetchFromGitHub
+, rustPlatform
+, pkg-config
+, dbus
+, libiconv
+, Security
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "maturin";
+  version = "0.11.3";
+
+  src = fetchFromGitHub {
+    owner = "PyO3";
+    repo = "maturin";
+    rev = "v${version}";
+    hash = "sha256-jWkrjFQg0EqM+e/IT2n2E4lGL2kT/Wz7r5BLlzvWSO0=";
+  };
+
+  cargoHash = "sha256-+kXwMGeE2HD59EU0Dzvg8I6LcHiPV7SKSFqnCTfkKwY=";
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = lib.optionals stdenv.isLinux [ dbus ]
+    ++ lib.optionals stdenv.isDarwin [ Security libiconv ];
+
+  # Requires network access, fails in sandbox.
+  doCheck = false;
+
+  passthru.tests.pyo3 = callPackage ./pyo3-test {};
+
+  meta = with lib; {
+    description = "Build and publish Rust crates Python packages";
+    longDescription = ''
+      Build and publish Rust crates with PyO3, rust-cpython, and
+      cffi bindings as well as Rust binaries as Python packages.
+
+      This project is meant as a zero-configuration replacement for
+      setuptools-rust and Milksnake. It supports building wheels for
+      Python and can upload them to PyPI.
+    '';
+    homepage = "https://github.com/PyO3/maturin";
+    license = licenses.asl20;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/maturin/pyo3-test/Cargo.lock.patch b/nixpkgs/pkgs/development/tools/rust/maturin/pyo3-test/Cargo.lock.patch
new file mode 100644
index 000000000000..3aca2e4803a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/maturin/pyo3-test/Cargo.lock.patch
@@ -0,0 +1,688 @@
+diff --git a/Cargo.lock b/Cargo.lock
+new file mode 100644
+index 000000000..5e698d4ff
+--- /dev/null
++++ b/Cargo.lock
+@@ -0,0 +1,682 @@
++# This file is automatically @generated by Cargo.
++# It is not intended for manual editing.
++[[package]]
++name = "ahash"
++version = "0.4.7"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e"
++
++[[package]]
++name = "assert_approx_eq"
++version = "1.1.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "3c07dab4369547dbe5114677b33fbbf724971019f3818172d59a97a61c774ffd"
++
++[[package]]
++name = "autocfg"
++version = "1.0.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
++
++[[package]]
++name = "bitflags"
++version = "1.2.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
++
++[[package]]
++name = "byteorder"
++version = "1.4.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b"
++
++[[package]]
++name = "cfg-if"
++version = "1.0.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
++
++[[package]]
++name = "const_fn"
++version = "0.4.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6"
++
++[[package]]
++name = "crossbeam-channel"
++version = "0.5.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775"
++dependencies = [
++ "cfg-if",
++ "crossbeam-utils",
++]
++
++[[package]]
++name = "crossbeam-deque"
++version = "0.8.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9"
++dependencies = [
++ "cfg-if",
++ "crossbeam-epoch",
++ "crossbeam-utils",
++]
++
++[[package]]
++name = "crossbeam-epoch"
++version = "0.9.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d"
++dependencies = [
++ "cfg-if",
++ "const_fn",
++ "crossbeam-utils",
++ "lazy_static",
++ "memoffset",
++ "scopeguard",
++]
++
++[[package]]
++name = "crossbeam-utils"
++version = "0.8.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d"
++dependencies = [
++ "autocfg",
++ "cfg-if",
++ "lazy_static",
++]
++
++[[package]]
++name = "ctor"
++version = "0.1.19"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e8f45d9ad417bcef4817d614a501ab55cdd96a6fdb24f49aab89a54acfd66b19"
++dependencies = [
++ "quote",
++ "syn",
++]
++
++[[package]]
++name = "either"
++version = "1.6.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
++
++[[package]]
++name = "getrandom"
++version = "0.1.16"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
++dependencies = [
++ "cfg-if",
++ "libc",
++ "wasi",
++]
++
++[[package]]
++name = "ghost"
++version = "0.1.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "1a5bcf1bbeab73aa4cf2fde60a846858dc036163c7c33bec309f8d17de785479"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "syn",
++]
++
++[[package]]
++name = "glob"
++version = "0.3.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
++
++[[package]]
++name = "hashbrown"
++version = "0.9.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
++dependencies = [
++ "ahash",
++]
++
++[[package]]
++name = "hermit-abi"
++version = "0.1.18"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c"
++dependencies = [
++ "libc",
++]
++
++[[package]]
++name = "indoc"
++version = "0.3.6"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "47741a8bc60fb26eb8d6e0238bbb26d8575ff623fdc97b1a2c00c050b9684ed8"
++dependencies = [
++ "indoc-impl",
++ "proc-macro-hack",
++]
++
++[[package]]
++name = "indoc-impl"
++version = "0.3.6"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ce046d161f000fffde5f432a0d034d0341dc152643b2598ed5bfce44c4f3a8f0"
++dependencies = [
++ "proc-macro-hack",
++ "proc-macro2",
++ "quote",
++ "syn",
++ "unindent",
++]
++
++[[package]]
++name = "instant"
++version = "0.1.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec"
++dependencies = [
++ "cfg-if",
++]
++
++[[package]]
++name = "inventory"
++version = "0.1.10"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "0f0f7efb804ec95e33db9ad49e4252f049e37e8b0a4652e3cd61f7999f2eff7f"
++dependencies = [
++ "ctor",
++ "ghost",
++ "inventory-impl",
++]
++
++[[package]]
++name = "inventory-impl"
++version = "0.1.10"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "75c094e94816723ab936484666968f5b58060492e880f3c8d00489a1e244fa51"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "syn",
++]
++
++[[package]]
++name = "itoa"
++version = "0.4.7"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
++
++[[package]]
++name = "lazy_static"
++version = "1.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
++
++[[package]]
++name = "libc"
++version = "0.2.86"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c"
++
++[[package]]
++name = "lock_api"
++version = "0.4.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312"
++dependencies = [
++ "scopeguard",
++]
++
++[[package]]
++name = "memoffset"
++version = "0.6.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87"
++dependencies = [
++ "autocfg",
++]
++
++[[package]]
++name = "num-bigint"
++version = "0.3.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "5e9a41747ae4633fce5adffb4d2e81ffc5e89593cb19917f8fb2cc5ff76507bf"
++dependencies = [
++ "autocfg",
++ "num-integer",
++ "num-traits",
++]
++
++[[package]]
++name = "num-complex"
++version = "0.3.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5"
++dependencies = [
++ "num-traits",
++]
++
++[[package]]
++name = "num-integer"
++version = "0.1.44"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
++dependencies = [
++ "autocfg",
++ "num-traits",
++]
++
++[[package]]
++name = "num-traits"
++version = "0.2.14"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
++dependencies = [
++ "autocfg",
++]
++
++[[package]]
++name = "num_cpus"
++version = "1.13.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
++dependencies = [
++ "hermit-abi",
++ "libc",
++]
++
++[[package]]
++name = "parking_lot"
++version = "0.11.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb"
++dependencies = [
++ "instant",
++ "lock_api",
++ "parking_lot_core",
++]
++
++[[package]]
++name = "parking_lot_core"
++version = "0.8.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018"
++dependencies = [
++ "cfg-if",
++ "instant",
++ "libc",
++ "redox_syscall",
++ "smallvec",
++ "winapi",
++]
++
++[[package]]
++name = "paste"
++version = "0.1.18"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880"
++dependencies = [
++ "paste-impl",
++ "proc-macro-hack",
++]
++
++[[package]]
++name = "paste-impl"
++version = "0.1.18"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6"
++dependencies = [
++ "proc-macro-hack",
++]
++
++[[package]]
++name = "ppv-lite86"
++version = "0.2.10"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
++
++[[package]]
++name = "proc-macro-hack"
++version = "0.5.19"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
++
++[[package]]
++name = "proc-macro2"
++version = "1.0.24"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
++dependencies = [
++ "unicode-xid",
++]
++
++[[package]]
++name = "proptest"
++version = "0.10.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "12e6c80c1139113c28ee4670dc50cc42915228b51f56a9e407f0ec60f966646f"
++dependencies = [
++ "bitflags",
++ "byteorder",
++ "lazy_static",
++ "num-traits",
++ "quick-error",
++ "rand",
++ "rand_chacha",
++ "rand_xorshift",
++ "regex-syntax",
++]
++
++[[package]]
++name = "pyo3"
++version = "0.13.2"
++dependencies = [
++ "assert_approx_eq",
++ "cfg-if",
++ "ctor",
++ "hashbrown",
++ "indoc",
++ "inventory",
++ "libc",
++ "num-bigint",
++ "num-complex",
++ "parking_lot",
++ "paste",
++ "proptest",
++ "pyo3",
++ "pyo3-macros",
++ "rustversion",
++ "serde",
++ "serde_json",
++ "trybuild",
++ "unindent",
++]
++
++[[package]]
++name = "pyo3-macros"
++version = "0.13.2"
++dependencies = [
++ "pyo3-macros-backend",
++ "quote",
++ "syn",
++]
++
++[[package]]
++name = "pyo3-macros-backend"
++version = "0.13.2"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "syn",
++]
++
++[[package]]
++name = "quick-error"
++version = "1.2.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
++
++[[package]]
++name = "quote"
++version = "1.0.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
++dependencies = [
++ "proc-macro2",
++]
++
++[[package]]
++name = "rand"
++version = "0.7.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
++dependencies = [
++ "getrandom",
++ "libc",
++ "rand_chacha",
++ "rand_core",
++ "rand_hc",
++]
++
++[[package]]
++name = "rand_chacha"
++version = "0.2.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
++dependencies = [
++ "ppv-lite86",
++ "rand_core",
++]
++
++[[package]]
++name = "rand_core"
++version = "0.5.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
++dependencies = [
++ "getrandom",
++]
++
++[[package]]
++name = "rand_hc"
++version = "0.2.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
++dependencies = [
++ "rand_core",
++]
++
++[[package]]
++name = "rand_xorshift"
++version = "0.2.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8"
++dependencies = [
++ "rand_core",
++]
++
++[[package]]
++name = "rayon"
++version = "1.5.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674"
++dependencies = [
++ "autocfg",
++ "crossbeam-deque",
++ "either",
++ "rayon-core",
++]
++
++[[package]]
++name = "rayon-core"
++version = "1.9.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a"
++dependencies = [
++ "crossbeam-channel",
++ "crossbeam-deque",
++ "crossbeam-utils",
++ "lazy_static",
++ "num_cpus",
++]
++
++[[package]]
++name = "redox_syscall"
++version = "0.2.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9"
++dependencies = [
++ "bitflags",
++]
++
++[[package]]
++name = "regex-syntax"
++version = "0.6.22"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581"
++
++[[package]]
++name = "rustapi-module"
++version = "0.1.0"
++dependencies = [
++ "pyo3",
++]
++
++[[package]]
++name = "rustversion"
++version = "1.0.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd"
++
++[[package]]
++name = "ryu"
++version = "1.0.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
++
++[[package]]
++name = "scopeguard"
++version = "1.1.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
++
++[[package]]
++name = "serde"
++version = "1.0.123"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae"
++dependencies = [
++ "serde_derive",
++]
++
++[[package]]
++name = "serde_derive"
++version = "1.0.123"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "syn",
++]
++
++[[package]]
++name = "serde_json"
++version = "1.0.62"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ea1c6153794552ea7cf7cf63b1231a25de00ec90db326ba6264440fa08e31486"
++dependencies = [
++ "itoa",
++ "ryu",
++ "serde",
++]
++
++[[package]]
++name = "smallvec"
++version = "1.6.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
++
++[[package]]
++name = "syn"
++version = "1.0.60"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "unicode-xid",
++]
++
++[[package]]
++name = "termcolor"
++version = "1.1.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
++dependencies = [
++ "winapi-util",
++]
++
++[[package]]
++name = "toml"
++version = "0.5.8"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
++dependencies = [
++ "serde",
++]
++
++[[package]]
++name = "trybuild"
++version = "1.0.41"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "99471a206425fba51842a9186315f32d91c56eadc21ea4c21f847b59cf778f8b"
++dependencies = [
++ "glob",
++ "lazy_static",
++ "serde",
++ "serde_json",
++ "termcolor",
++ "toml",
++]
++
++[[package]]
++name = "unicode-xid"
++version = "0.2.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
++
++[[package]]
++name = "unindent"
++version = "0.1.7"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "f14ee04d9415b52b3aeab06258a3f07093182b88ba0f9b8d203f211a7a7d41c7"
++
++[[package]]
++name = "wasi"
++version = "0.9.0+wasi-snapshot-preview1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
++
++[[package]]
++name = "winapi"
++version = "0.3.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
++dependencies = [
++ "winapi-i686-pc-windows-gnu",
++ "winapi-x86_64-pc-windows-gnu",
++]
++
++[[package]]
++name = "winapi-i686-pc-windows-gnu"
++version = "0.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
++
++[[package]]
++name = "winapi-util"
++version = "0.1.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
++dependencies = [
++ "winapi",
++]
++
++[[package]]
++name = "winapi-x86_64-pc-windows-gnu"
++version = "0.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
++
++[[package]]
++name = "word-count"
++version = "0.1.0"
++dependencies = [
++ "pyo3",
++ "rayon",
++]
diff --git a/nixpkgs/pkgs/development/tools/rust/maturin/pyo3-test/default.nix b/nixpkgs/pkgs/development/tools/rust/maturin/pyo3-test/default.nix
new file mode 100644
index 000000000000..7f79c8565d23
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/maturin/pyo3-test/default.nix
@@ -0,0 +1,12 @@
+{ python3
+, rustPlatform
+}:
+
+python3.pkgs.callPackage ./generic.nix {
+  buildAndTestSubdir = "examples/word-count";
+
+  nativeBuildInputs = with rustPlatform; [
+    cargoSetupHook
+    maturinBuildHook
+  ];
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix b/nixpkgs/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix
new file mode 100644
index 000000000000..547f11125b70
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix
@@ -0,0 +1,45 @@
+# Derivation prototype, used by maturin and setuptools-rust
+# passthrough tests.
+
+{ lib
+, fetchFromGitHub
+, python
+, rustPlatform
+
+, nativeBuildInputs
+
+, buildAndTestSubdir ? null
+, format ? "pyproject"
+, preConfigure ? ""
+}:
+
+python.pkgs.buildPythonPackage rec {
+  pname = "word-count";
+  version = "0.13.2";
+
+  src = fetchFromGitHub {
+    owner = "PyO3";
+    repo = "pyo3";
+    rev = "v${version}";
+    hash = "sha256-NOMrrfo8WjlPhtGxWUOPJS/UDDdbLQRCXR++Zd6JmIA=";
+  };
+
+  cargoDeps = rustPlatform.fetchCargoTarball {
+    inherit src patches;
+    name = "${pname}-${version}";
+    hash = "sha256-u3L9nXHKILznyZTgxdvZyOCQZFZhuADrtI7zXYQzrbE=";
+  };
+
+  patches = [ ./Cargo.lock.patch ];
+
+  inherit buildAndTestSubdir format nativeBuildInputs preConfigure;
+
+  pythonImportsCheck = [ "word_count" ];
+
+  meta = with lib; {
+    description = "PyO3 word count example";
+    homepage = "https://github.com/PyO3/pyo3";
+    license = licenses.asl20;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/panamax/default.nix b/nixpkgs/pkgs/development/tools/rust/panamax/default.nix
new file mode 100644
index 000000000000..0d040afd421d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/panamax/default.nix
@@ -0,0 +1,24 @@
+{ lib, rustPlatform, fetchCrate, pkg-config, openssl, stdenv, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "panamax";
+  version = "1.0.3";
+
+  src = fetchCrate {
+    inherit pname version;
+    sha256 = "sha256-w4waFdzd/Ps0whOp39QLBE/YF2eyc4t2Ili7FskUt1M=";
+  };
+
+  cargoSha256 = "sha256-52snmkTFHI26xJo9qJkmqh1M5lLzhDxw8WT6uFd57aw=";
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ openssl ] ++ lib.optional stdenv.isDarwin Security;
+
+  meta = with lib; {
+    description = "Mirror rustup and crates.io repositories for offline Rust and cargo usage";
+    homepage = "https://github.com/panamax-rs/panamax";
+    license = with licenses; [ mit /* or */ asl20 ];
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/probe-run/default.nix b/nixpkgs/pkgs/development/tools/rust/probe-run/default.nix
new file mode 100644
index 000000000000..4980baf85e2a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/probe-run/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, libusb1
+, libiconv, AppKit, IOKit }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "probe-run";
+  version = "0.2.5";
+
+  src = fetchFromGitHub {
+    owner = "knurling-rs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0bj5arngc49mdz1i7bbg4l7rb741x7dhalpdxrn55vzlvgbig8fv";
+  };
+
+  cargoSha256 = "1kqgl1f91aa7kz1yprpyf9pl1vp4ahhw8ka5hrvfvk5i5i54pigz";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libusb1 ]
+    ++ lib.optionals stdenv.isDarwin [ libiconv AppKit IOKit ];
+
+  meta = with lib; {
+    description = "Run embedded programs just like native ones.";
+    homepage = "https://github.com/knurling-rs/probe-run";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ hoverbear ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/racer/default.nix b/nixpkgs/pkgs/development/tools/rust/racer/default.nix
new file mode 100644
index 000000000000..e0e22f0f504f
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/racer/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitHub, rustPlatform, makeWrapper, substituteAll, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "racer";
+  version = "2.1.46";
+
+  src = fetchFromGitHub {
+    owner = "racer-rust";
+    repo = "racer";
+    rev = "v${version}";
+    sha256 = "sha256-7h1w5Yyt5VN6+pYuTTbdM1Nrd8aDEhPLusxuIsdS+mQ=";
+  };
+
+  cargoSha256 = "sha256-fllhB+so6H36b+joW0l+NBtz3PefOKdj6C8qKQPuJpk=";
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = lib.optional stdenv.isDarwin Security;
+
+  # a nightly compiler is required unless we use this cheat code.
+  RUSTC_BOOTSTRAP = 1;
+
+  RUST_SRC_PATH = rustPlatform.rustLibSrc;
+  postInstall = ''
+    wrapProgram $out/bin/racer --set-default RUST_SRC_PATH ${rustPlatform.rustLibSrc}
+  '';
+
+  checkFlags = [
+    "--skip nameres::test_do_file_search_std"
+    "--skip util::test_get_rust_src_path_rustup_ok"
+    "--skip util::test_get_rust_src_path_not_rust_source_tree"
+    "--skip extern --skip completes_pub_fn --skip find_crate_doc"
+    "--skip follows_use_local_package --skip follows_use_for_reexport"
+    "--skip follows_rand_crate --skip get_completion_in_example_dir"
+    "--skip test_resolve_global_path_in_modules"
+  ];
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    $out/bin/racer --version
+  '';
+
+  meta = with lib; {
+    description = "A utility intended to provide Rust code completion for editors and IDEs";
+    homepage = "https://github.com/racer-rust/racer";
+    license = licenses.mit;
+    maintainers = with maintainers; [ jagajaga ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/racerd/default.nix b/nixpkgs/pkgs/development/tools/rust/racerd/default.nix
new file mode 100644
index 000000000000..6ffa49aa6b9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/racerd/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, rustPlatform, makeWrapper, Security }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "racerd";
+  version = "unstable-2019-09-02";
+
+  src = fetchFromGitHub {
+    owner = "jwilm";
+    repo = "racerd";
+    rev = "e3d380b9a1d3f3b67286d60465746bc89fea9098";
+    sha256 = "13jqdvjk4savcl03mrn2vzgdsd7vxv2racqbyavrxp2cm9h6cjln";
+  };
+
+  cargoPatches = [
+    (fetchpatch {
+      url = "https://github.com/jwilm/racerd/commit/856f3656e160cd2909c5166e962f422c901720ee.patch";
+      sha256 = "1qq2k4bnwjz5qgn7s8yxd090smwn2wvdm8dd1rrlgpln0a5vxkpb";
+    })
+  ];
+
+  cargoSha256 = "08zn65c5ivhn2qs02aiixyqwhywrw8kfvs0kgzxdzsipic47n2qq";
+
+  # a nightly compiler is required unless we use this cheat code.
+  RUSTC_BOOTSTRAP=1;
+
+  doCheck = false;
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = lib.optional stdenv.isDarwin Security;
+
+  RUST_SRC_PATH = rustPlatform.rustcSrc;
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -p $releaseDir/racerd $out/bin/
+    wrapProgram $out/bin/racerd --set-default RUST_SRC_PATH "$RUST_SRC_PATH"
+  '';
+
+  meta = with lib; {
+    broken = true;
+    description = "JSON/HTTP Server based on racer for adding Rust support to editors and IDEs";
+    homepage = "https://github.com/jwilm/racerd";
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/rhack/default.nix b/nixpkgs/pkgs/development/tools/rust/rhack/default.nix
new file mode 100644
index 000000000000..d141c43dd914
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rhack/default.nix
@@ -0,0 +1,22 @@
+{ lib, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "rhack";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "nakabonne";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "088ynf65szaa86pxwwasn3wwi00z5pn7i8w9gh5dyn983z4d8237";
+  };
+
+  cargoSha256 = "sha256-HmBh2qbO/HuNPfHKifq41IB5ResnGka2iaAsnwppm9s=";
+
+  meta = with lib; {
+    description = "Temporary edit external crates that your project depends on";
+    homepage = "https://github.com/nakabonne/rhack";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix
new file mode 100644
index 000000000000..81bb8405d1b3
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv, fetchFromGitHub, rustPlatform, CoreServices, cmake
+, libiconv
+, useMimalloc ? false
+, doCheck ? true
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "rust-analyzer-unwrapped";
+  version = "2021-09-20";
+  cargoSha256 = "sha256-OPolZ0oXGRcKvWxXkRMjyEXzvf1p41hGfHBpbDbLJck=";
+
+  src = fetchFromGitHub {
+    owner = "rust-analyzer";
+    repo = "rust-analyzer";
+    rev = version;
+    sha256 = "sha256-k2UGz+h9++8wtV+XdGZbWysjkIDe+UNudKL46eisZzw=";
+  };
+
+  patches = [
+    # Code format and git history check require more dependencies but don't really matter for packaging.
+    # So just ignore them.
+    ./ignore-git-and-rustfmt-tests.patch
+
+    # Patch for our rust 1.54.0 in nixpkgs. Remove it when we have rust >= 1.55.0
+    ./no-1-55-control-flow.patch
+  ];
+
+  buildAndTestSubdir = "crates/rust-analyzer";
+
+  cargoBuildFlags = lib.optional useMimalloc "--features=mimalloc";
+  cargoTestFlags = lib.optional useMimalloc "--features=mimalloc";
+
+  nativeBuildInputs = lib.optional useMimalloc cmake;
+
+  buildInputs = lib.optionals stdenv.isDarwin [
+    CoreServices
+    libiconv
+  ];
+
+  RUST_ANALYZER_REV = version;
+
+  inherit doCheck;
+  preCheck = lib.optionalString doCheck ''
+    export RUST_SRC_PATH=${rustPlatform.rustLibSrc}
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    runHook preInstallCheck
+    versionOutput="$($out/bin/rust-analyzer --version)"
+    echo "'rust-analyzer --version' returns: $versionOutput"
+    [[ "$versionOutput" == "rust-analyzer ${version}" ]]
+    runHook postInstallCheck
+  '';
+
+  passthru.updateScript = ./update.sh;
+
+  meta = with lib; {
+    description = "An experimental modular compiler frontend for the Rust language";
+    homepage = "https://github.com/rust-analyzer/rust-analyzer";
+    license = with licenses; [ mit asl20 ];
+    maintainers = with maintainers; [ oxalica ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/rust-analyzer/ignore-git-and-rustfmt-tests.patch b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/ignore-git-and-rustfmt-tests.patch
new file mode 100644
index 000000000000..1247e4804684
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/ignore-git-and-rustfmt-tests.patch
@@ -0,0 +1,18 @@
+--- a/crates/rust-analyzer/tests/slow-tests/tidy.rs
++++ b/crates/rust-analyzer/tests/slow-tests/tidy.rs
+@@ -6,6 +6,7 @@ use std::{
+ use xshell::{cmd, pushd, pushenv, read_file};
+ 
+ #[test]
++#[ignore]
+ fn check_code_formatting() {
+     let _dir = pushd(sourcegen::project_root()).unwrap();
+     let _e = pushenv("RUSTUP_TOOLCHAIN", "stable");
+@@ -138,6 +139,7 @@ fn check_cargo_toml(path: &Path, text: String) -> () {
+ }
+ 
+ #[test]
++#[ignore]
+ fn check_merge_commits() {
+     let stdout = cmd!("git rev-list --merges --invert-grep --author 'bors\\[bot\\]' HEAD~19..")
+         .read()
diff --git a/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-1-55-control-flow.patch b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-1-55-control-flow.patch
new file mode 100644
index 000000000000..67f7686ffb4f
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-1-55-control-flow.patch
@@ -0,0 +1,212 @@
+diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
+index 3b0c29e87..2841a39e2 100644
+--- a/crates/hir/src/lib.rs
++++ b/crates/hir/src/lib.rs
+@@ -31,7 +31,7 @@ pub mod db;
+ 
+ mod display;
+ 
+-use std::{iter, ops::ControlFlow, sync::Arc};
++use std::{iter, sync::Arc};
+ 
+ use arrayvec::ArrayVec;
+ use base_db::{CrateDisplayName, CrateId, Edition, FileId};
+@@ -70,7 +70,7 @@ use itertools::Itertools;
+ use nameres::diagnostics::DefDiagnosticKind;
+ use once_cell::unsync::Lazy;
+ use rustc_hash::FxHashSet;
+-use stdx::{format_to, impl_from};
++use stdx::{format_to, impl_from, ControlFlow};
+ use syntax::{
+     ast::{self, AttrsOwner, NameOwner},
+     AstNode, AstPtr, SmolStr, SyntaxKind, SyntaxNodePtr,
+diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs
+index c88a8b653..039b5589e 100644
+--- a/crates/hir_ty/src/method_resolution.rs
++++ b/crates/hir_ty/src/method_resolution.rs
+@@ -2,7 +2,7 @@
+ //! For details about how this works in rustc, see the method lookup page in the
+ //! [rustc guide](https://rust-lang.github.io/rustc-guide/method-lookup.html)
+ //! and the corresponding code mostly in librustc_typeck/check/method/probe.rs.
+-use std::{iter, ops::ControlFlow, sync::Arc};
++use std::{iter, sync::Arc};
+ 
+ use arrayvec::ArrayVec;
+ use base_db::{CrateId, Edition};
+@@ -13,6 +13,7 @@ use hir_def::{
+ };
+ use hir_expand::name::Name;
+ use rustc_hash::{FxHashMap, FxHashSet};
++use stdx::{try_control_flow, ControlFlow};
+ 
+ use crate::{
+     autoderef,
+@@ -483,7 +484,7 @@ pub fn iterate_method_candidates_dyn(
+ 
+             let deref_chain = autoderef_method_receiver(db, krate, ty);
+             for i in 0..deref_chain.len() {
+-                iterate_method_candidates_with_autoref(
++                try_control_flow!(iterate_method_candidates_with_autoref(
+                     &deref_chain[i..],
+                     db,
+                     env.clone(),
+@@ -492,7 +493,7 @@ pub fn iterate_method_candidates_dyn(
+                     visible_from_module,
+                     name,
+                     callback,
+-                )?;
++                ));
+             }
+             ControlFlow::Continue(())
+         }
+@@ -522,7 +523,7 @@ fn iterate_method_candidates_with_autoref(
+     name: Option<&Name>,
+     mut callback: &mut dyn FnMut(&Canonical<Ty>, AssocItemId) -> ControlFlow<()>,
+ ) -> ControlFlow<()> {
+-    iterate_method_candidates_by_receiver(
++    try_control_flow!(iterate_method_candidates_by_receiver(
+         &deref_chain[0],
+         &deref_chain[1..],
+         db,
+@@ -532,7 +533,7 @@ fn iterate_method_candidates_with_autoref(
+         visible_from_module,
+         name,
+         &mut callback,
+-    )?;
++    ));
+ 
+     let refed = Canonical {
+         binders: deref_chain[0].binders.clone(),
+@@ -540,7 +541,7 @@ fn iterate_method_candidates_with_autoref(
+             .intern(&Interner),
+     };
+ 
+-    iterate_method_candidates_by_receiver(
++    try_control_flow!(iterate_method_candidates_by_receiver(
+         &refed,
+         deref_chain,
+         db,
+@@ -550,7 +551,7 @@ fn iterate_method_candidates_with_autoref(
+         visible_from_module,
+         name,
+         &mut callback,
+-    )?;
++    ));
+ 
+     let ref_muted = Canonical {
+         binders: deref_chain[0].binders.clone(),
+@@ -586,7 +587,7 @@ fn iterate_method_candidates_by_receiver(
+     // be found in any of the derefs of receiver_ty, so we have to go through
+     // that.
+     for self_ty in std::iter::once(receiver_ty).chain(rest_of_deref_chain) {
+-        iterate_inherent_methods(
++        try_control_flow!(iterate_inherent_methods(
+             self_ty,
+             db,
+             env.clone(),
+@@ -595,11 +596,11 @@ fn iterate_method_candidates_by_receiver(
+             krate,
+             visible_from_module,
+             &mut callback,
+-        )?
++        ))
+     }
+ 
+     for self_ty in std::iter::once(receiver_ty).chain(rest_of_deref_chain) {
+-        iterate_trait_method_candidates(
++        try_control_flow!(iterate_trait_method_candidates(
+             self_ty,
+             db,
+             env.clone(),
+@@ -608,7 +609,7 @@ fn iterate_method_candidates_by_receiver(
+             name,
+             Some(receiver_ty),
+             &mut callback,
+-        )?
++        ))
+     }
+ 
+     ControlFlow::Continue(())
+@@ -624,7 +625,7 @@ fn iterate_method_candidates_for_self_ty(
+     name: Option<&Name>,
+     mut callback: &mut dyn FnMut(&Canonical<Ty>, AssocItemId) -> ControlFlow<()>,
+ ) -> ControlFlow<()> {
+-    iterate_inherent_methods(
++    try_control_flow!(iterate_inherent_methods(
+         self_ty,
+         db,
+         env.clone(),
+@@ -633,7 +634,7 @@ fn iterate_method_candidates_for_self_ty(
+         krate,
+         visible_from_module,
+         &mut callback,
+-    )?;
++    ));
+     iterate_trait_method_candidates(self_ty, db, env, krate, traits_in_scope, name, None, callback)
+ }
+ 
+@@ -697,7 +698,7 @@ fn iterate_trait_method_candidates(
+             }
+             known_implemented = true;
+             // FIXME: we shouldn't be ignoring the binders here
+-            callback(self_ty, *item)?
++            try_control_flow!(callback(self_ty, *item))
+         }
+     }
+     ControlFlow::Continue(())
+@@ -774,7 +775,7 @@ fn iterate_inherent_methods(
+                     continue;
+                 }
+                 let receiver_ty = receiver_ty.unwrap_or(self_ty);
+-                callback(receiver_ty, item)?;
++                try_control_flow!(callback(receiver_ty, item));
+             }
+         }
+     }
+diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
+index 506d3ba3c..590963c17 100644
+--- a/crates/ide/src/hover.rs
++++ b/crates/ide/src/hover.rs
+@@ -1,4 +1,4 @@
+-use std::{collections::HashSet, ops::ControlFlow};
++use std::collections::HashSet;
+ 
+ use either::Either;
+ use hir::{AsAssocItem, HasAttrs, HasSource, HirDisplay, Semantics, TypeInfo};
+@@ -12,7 +12,7 @@ use ide_db::{
+     RootDatabase,
+ };
+ use itertools::Itertools;
+-use stdx::format_to;
++use stdx::{format_to, ControlFlow};
+ use syntax::{
+     algo, ast, display::fn_as_proc_macro_label, match_ast, AstNode, Direction, SyntaxKind::*,
+     SyntaxNode, SyntaxToken, TextRange, TextSize, T,
+diff --git a/crates/stdx/src/lib.rs b/crates/stdx/src/lib.rs
+index e7d4753de..fddf95147 100644
+--- a/crates/stdx/src/lib.rs
++++ b/crates/stdx/src/lib.rs
+@@ -7,6 +7,22 @@ pub mod panic_context;
+ 
+ pub use always_assert::{always, never};
+ 
++/// std::ops::ControlFlow from rust std 1.55.0
++pub enum ControlFlow<B, C = ()> {
++    Continue(C),
++    Break(B),
++}
++
++#[macro_export]
++macro_rules! try_control_flow {
++    ($e:expr) => {
++        match $e {
++            $crate::ControlFlow::Continue(c) => c,
++            $crate::ControlFlow::Break(b) => return $crate::ControlFlow::Break(b),
++        }
++    };
++}
++
+ #[inline(always)]
+ pub fn is_ci() -> bool {
+     option_env!("CI").is_some()
+
diff --git a/nixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh
new file mode 100755
index 000000000000..add400e4d0e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh
@@ -0,0 +1,77 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl jq nix-prefetch libarchive
+set -euo pipefail
+cd "$(dirname "$0")"
+owner=rust-analyzer
+repo=rust-analyzer
+nixpkgs=../../../../..
+
+# Update lsp
+
+ver=$(
+    curl -s "https://api.github.com/repos/$owner/$repo/releases" |
+    jq 'map(select(.prerelease | not)) | .[0].tag_name' --raw-output
+)
+old_ver=$(sed -nE 's/.*\bversion = "(.*)".*/\1/p' ./default.nix)
+if grep -q 'cargoSha256 = ""' ./default.nix; then
+    old_ver='broken'
+fi
+if [[ "$ver" == "$old_ver" ]]; then
+    echo "Up to date: $ver"
+    exit
+fi
+echo "$old_ver -> $ver"
+
+sha256=$(nix-prefetch -f "$nixpkgs" rust-analyzer-unwrapped.src --rev "$ver")
+# Clear cargoSha256 to avoid inconsistency.
+sed -e "s#version = \".*\"#version = \"$ver\"#" \
+    -e "/fetchFromGitHub/,/}/ s#sha256 = \".*\"#sha256 = \"$sha256\"#" \
+    -e "s#cargoSha256 = \".*\"#cargoSha256 = \"sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"#" \
+    --in-place ./default.nix
+node_src="$(nix-build "$nixpkgs" -A rust-analyzer.src --no-out-link)/editors/code"
+
+# Check vscode compatibility
+req_vscode_ver="$(jq '.engines.vscode' "$node_src/package.json" --raw-output)"
+req_vscode_ver="${req_vscode_ver#^}"
+cur_vscode_ver="$(nix-instantiate --eval --strict "$nixpkgs" -A vscode.version | tr -d '"')"
+if [[ "$(nix-instantiate --eval --strict -E "(builtins.compareVersions \"$req_vscode_ver\" \"$cur_vscode_ver\")")" -gt 0 ]]; then
+    echo "vscode $cur_vscode_ver is incompatible with the extension requiring ^$req_vscode_ver"
+    exit 1
+fi
+
+echo "Prebuilding for cargoSha256"
+cargo_sha256=$(nix-prefetch "{ sha256 }: (import $nixpkgs {}).rust-analyzer-unwrapped.cargoDeps.overrideAttrs (_: { outputHash = sha256; })")
+sed "s#cargoSha256 = \".*\"#cargoSha256 = \"$cargo_sha256\"#" \
+    --in-place ./default.nix
+
+# Update vscode extension
+
+extension_ver=$(curl "https://github.com/rust-analyzer/rust-analyzer/releases/download/$ver/rust-analyzer.vsix" -L |
+    bsdtar -xf - --to-stdout extension/package.json | # Use bsdtar to extract vsix(zip).
+    jq --raw-output '.version')
+echo "Extension version: $extension_ver"
+
+build_deps="../../../../misc/vscode-extensions/rust-analyzer/build-deps"
+# We need devDependencies to build vsix.
+# `esbuild` is a binary package an is already in nixpkgs so we omit it here.
+jq '{ name, version: $ver, dependencies: (.dependencies + .devDependencies | del(.esbuild)) }' "$node_src/package.json" \
+    --arg ver "$extension_ver" \
+    >"$build_deps/package.json.new"
+
+old_deps="$(jq '.dependencies' "$build_deps"/package.json)"
+new_deps="$(jq '.dependencies' "$build_deps"/package.json.new)"
+if [[ "$old_deps" == "$new_deps" ]]; then
+    echo "package.json dependencies not changed, do simple version change"
+
+    sed -E '/^  "rust-analyzer-build-deps/,+3 s/version = ".*"/version = "'"$extension_ver"'"/' \
+        --in-place ../../../node-packages/node-packages.nix
+    mv "$build_deps"/package.json{.new,}
+
+else
+    echo "package.json dependencies changed, updating nodePackages"
+    mv "$build_deps"/package.json{.new,}
+
+    pushd "../../../node-packages"
+    ./generate.sh
+    popd
+fi
diff --git a/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix
new file mode 100644
index 000000000000..6fa5207de6eb
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix
@@ -0,0 +1,15 @@
+{ lib, rustPlatform, runCommand, makeWrapper, rust-analyzer-unwrapped
+, pname ? "rust-analyzer"
+, version ? rust-analyzer-unwrapped.version
+  # Use name from `RUST_SRC_PATH`
+, rustSrc ? rustPlatform.rustLibSrc
+}:
+runCommand "${pname}-${version}" {
+  inherit pname version;
+  inherit (rust-analyzer-unwrapped) src meta;
+  nativeBuildInputs = [ makeWrapper ];
+} ''
+  mkdir -p $out/bin
+  makeWrapper ${rust-analyzer-unwrapped}/bin/rust-analyzer $out/bin/rust-analyzer \
+    --set-default RUST_SRC_PATH "${rustSrc}"
+''
diff --git a/nixpkgs/pkgs/development/tools/rust/rust-script/default.nix b/nixpkgs/pkgs/development/tools/rust/rust-script/default.nix
new file mode 100644
index 000000000000..b13a1f66db2d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rust-script/default.nix
@@ -0,0 +1,26 @@
+{ lib, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "rust-script";
+  version = "0.17.0";
+
+  src = fetchFromGitHub {
+    owner = "fornwall";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0jz8hlvl31c5h8whd6pnpmslw6w6alkxijd9lhgric1yypiym9x3";
+  };
+
+  cargoSha256 = "sha256-hg0QtxR1qm/x8G6HoN7xAyOwh9jiQvX2wWYjUR8YvMs=";
+
+  # TODO: switch to `cargoCheckType = "false"` after #138822 is merged
+  # tests only work in debug mode
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Run Rust files and expressions as scripts without any setup or compilation step";
+    homepage = "https://rust-script.org";
+    license = with licenses; [ mit /* or */ asl20 ];
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/rustup-toolchain-install-master/0001-dynamically-patchelf-binaries.patch b/nixpkgs/pkgs/development/tools/rust/rustup-toolchain-install-master/0001-dynamically-patchelf-binaries.patch
new file mode 100644
index 000000000000..1754ce11c4d3
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rustup-toolchain-install-master/0001-dynamically-patchelf-binaries.patch
@@ -0,0 +1,61 @@
+diff --git a/src/main.rs b/src/main.rs
+index 3cb6896..7f070e0 100644
+--- a/src/main.rs
++++ b/src/main.rs
+@@ -275,7 +275,9 @@ fn install_single_toolchain(
+
+     // install
+     if maybe_dry_client.is_some() {
+-        rename(&toolchain.dest, toolchain_path)?;
++        rename(&toolchain.dest, toolchain_path.clone())?;
++        nix_patchelf(toolchain_path)
++            .expect("failed to patch toolchain for NixOS");
+         eprintln!(
+             "toolchain `{}` is successfully installed!",
+             toolchain.dest.display()
+@@ -291,6 +293,45 @@ fn install_single_toolchain(
+     Ok(())
+ }
+
++fn nix_patchelf(mut toolchain_path: PathBuf) -> Result<(), Error> {
++    toolchain_path.push("bin");
++
++    for entry in toolchain_path.read_dir()? {
++        let entry = entry?;
++        if !entry.file_type()?.is_file() {
++            continue;
++        }
++
++        eprintln!("info: you seem to be running NixOS. Attempting to patch {}",
++                  entry.path().to_str().unwrap());
++        let _ = ::std::process::Command::new("@patchelf@/bin/patchelf")
++            .arg("--set-interpreter")
++            .arg("@dynamicLinker@")
++            .arg(entry.path())
++            .output();
++    }
++
++    toolchain_path.pop();
++    toolchain_path.push("lib");
++
++    for entry in toolchain_path.read_dir()? {
++        let entry = entry?;
++        if !entry.file_type()?.is_file() {
++            continue;
++        }
++
++        eprintln!("info: you seem to be running NixOS. Attempting to patch {}",
++                  entry.path().to_str().unwrap());
++        let _ = ::std::process::Command::new("@patchelf@/bin/patchelf")
++            .arg("--set-rpath")
++            .arg("@libPath@")
++            .arg(entry.path())
++            .output();
++    }
++
++    Ok(())
++}
++
+ fn fetch_master_commit(client: &Client, github_token: Option<&str>) -> Result<String, Error> {
+     eprintln!("fetching master commit hash... ");
+     fetch_master_commit_via_git()
diff --git a/nixpkgs/pkgs/development/tools/rust/rustup-toolchain-install-master/default.nix b/nixpkgs/pkgs/development/tools/rust/rustup-toolchain-install-master/default.nix
new file mode 100644
index 000000000000..cae5453fa661
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rustup-toolchain-install-master/default.nix
@@ -0,0 +1,56 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, rustPlatform
+, pkg-config
+, openssl
+, runCommand
+, patchelf
+, zlib
+, Security
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "rustup-toolchain-install-master";
+  version = "1.7.3";
+
+  src = fetchFromGitHub {
+    owner = "kennytm";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-J25ER/g8Kylw/oTIEl4Gl8i1xmhR+4JM5M5EHpl1ras=";
+  };
+
+  patches =
+    let
+      patchelfPatch = runCommand "0001-dynamically-patchelf-binaries.patch" {
+        CC = stdenv.cc;
+        patchelf = patchelf;
+        libPath = "$ORIGIN/../lib:${lib.makeLibraryPath [ zlib ]}";
+      }
+      ''
+        export dynamicLinker=$(cat $CC/nix-support/dynamic-linker)
+        substitute ${./0001-dynamically-patchelf-binaries.patch} $out \
+          --subst-var patchelf \
+          --subst-var dynamicLinker \
+          --subst-var libPath
+      '';
+    in
+    lib.optionals stdenv.isLinux [ patchelfPatch ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    openssl
+  ] ++ lib.optionals stdenv.isDarwin [
+    Security
+  ];
+
+  cargoSha256 = "n7t8Ap9hdhrjmtKjfdyozf26J7yhu57pedm19CunLF4=";
+
+  meta = with lib; {
+    description = "Install a rustc master toolchain usable from rustup";
+    homepage = "https://github.com/kennytm/rustup-toolchain-install-master";
+    license = licenses.mit;
+    maintainers = with maintainers; [ davidtwco ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/rustup/0001-dynamically-patchelf-binaries.patch b/nixpkgs/pkgs/development/tools/rust/rustup/0001-dynamically-patchelf-binaries.patch
new file mode 100644
index 000000000000..13649b387a3e
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rustup/0001-dynamically-patchelf-binaries.patch
@@ -0,0 +1,42 @@
+diff --git a/src/dist/component/package.rs b/src/dist/component/package.rs
+index 3beddf54..0f859b8d 100644
+--- a/src/dist/component/package.rs
++++ b/src/dist/component/package.rs
+@@ -113,6 +113,7 @@ impl Package for DirectoryPackage {
+                     } else {
+                         builder.move_file(path.clone(), &src_path)?
+                     }
++                    nix_patchelf_if_needed(&target.prefix().path().join(path.clone()), &src_path)
+                 }
+                 "dir" => {
+                     if self.copy {
+@@ -135,6 +136,29 @@ impl Package for DirectoryPackage {
+     }
+ }
+ 
++fn nix_patchelf_if_needed(dest_path: &Path, src_path: &Path) {
++    let (is_bin, is_lib) = if let Some(p) = src_path.parent() {
++        (p.ends_with("bin"), p.ends_with("lib"))
++    } else {
++        (false, false)
++    };
++
++    if is_bin {
++        let _ = ::std::process::Command::new("@patchelf@/bin/patchelf")
++            .arg("--set-interpreter")
++            .arg("@dynamicLinker@")
++            .arg(dest_path)
++            .output();
++    }
++    else if is_lib {
++        let _ = ::std::process::Command::new("@patchelf@/bin/patchelf")
++            .arg("--set-rpath")
++            .arg("@libPath@")
++            .arg(dest_path)
++            .output();
++    }
++}
++
+ #[derive(Debug)]
+ pub struct TarPackage<'a>(DirectoryPackage, temp::Dir<'a>);
+ 
diff --git a/nixpkgs/pkgs/development/tools/rust/rustup/default.nix b/nixpkgs/pkgs/development/tools/rust/rustup/default.nix
new file mode 100644
index 000000000000..f5e3b9ac4c2f
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rustup/default.nix
@@ -0,0 +1,92 @@
+{ stdenv
+, lib
+, runCommand
+, patchelf
+, fetchFromGitHub
+, rustPlatform
+, makeWrapper
+, pkg-config
+, curl
+, zlib
+, Security
+, CoreServices
+, libiconv
+, xz
+}:
+
+let
+  libPath = lib.makeLibraryPath [
+    zlib # libz.so.1
+  ];
+in
+
+rustPlatform.buildRustPackage rec {
+  pname = "rustup";
+  version = "1.24.3";
+
+  src = fetchFromGitHub {
+    owner = "rust-lang";
+    repo = "rustup";
+    rev = version;
+    sha256 = "sha256-JpOOFwlTgwwBCrXOGYskFTgS6RZ7mHQJGT0jnHavxvI=";
+  };
+
+  cargoSha256 = "sha256-hAfGpKaWD94IxFFpnW9XwQp4P9clUX6mmekwodCK0Ag=";
+
+  nativeBuildInputs = [ makeWrapper pkg-config ];
+
+  buildInputs = [
+    curl
+    zlib
+  ] ++ lib.optionals stdenv.isDarwin [ CoreServices Security libiconv xz ];
+
+  cargoBuildFlags = [ "--features no-self-update" ];
+
+  patches = lib.optionals stdenv.isLinux [
+    (runCommand "0001-dynamically-patchelf-binaries.patch" { CC = stdenv.cc; patchelf = patchelf; libPath = "$ORIGIN/../lib:${libPath}"; } ''
+      export dynamicLinker=$(cat $CC/nix-support/dynamic-linker)
+      substitute ${./0001-dynamically-patchelf-binaries.patch} $out \
+        --subst-var patchelf \
+        --subst-var dynamicLinker \
+        --subst-var libPath
+    '')
+  ];
+
+  doCheck = !stdenv.isAarch64 && !stdenv.isDarwin;
+
+  postInstall = ''
+    pushd $out/bin
+    mv rustup-init rustup
+    binlinks=(
+      cargo rustc rustdoc rust-gdb rust-lldb rls rustfmt cargo-fmt
+      cargo-clippy clippy-driver cargo-miri
+    )
+    for link in ''${binlinks[@]}; do
+      ln -s rustup $link
+    done
+    popd
+
+    wrapProgram $out/bin/rustup --prefix "LD_LIBRARY_PATH" : "${libPath}"
+
+    # tries to create .rustup
+    export HOME=$(mktemp -d)
+    mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
+
+    # generate completion scripts for rustup
+    $out/bin/rustup completions bash rustup > "$out/share/bash-completion/completions/rustup"
+    $out/bin/rustup completions fish rustup > "$out/share/fish/vendor_completions.d/rustup.fish"
+    $out/bin/rustup completions zsh rustup >  "$out/share/zsh/site-functions/_rustup"
+
+    # generate completion scripts for cargo
+    # Note: fish completion script is not supported.
+    $out/bin/rustup completions bash cargo > "$out/share/bash-completion/completions/cargo"
+    $out/bin/rustup completions zsh cargo >  "$out/share/zsh/site-functions/_cargo"
+  '';
+
+  meta = with lib; {
+    description = "The Rust toolchain installer";
+    homepage = "https://www.rustup.rs/";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = [ maintainers.mic92 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/sqlx-cli/default.nix b/nixpkgs/pkgs/development/tools/rust/sqlx-cli/default.nix
new file mode 100644
index 000000000000..15b6b085bb05
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/sqlx-cli/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, rustPlatform, fetchFromGitHub, pkg-config, openssl, SystemConfiguration, CoreFoundation, Security, libiconv }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "sqlx-cli";
+  version = "0.5.7";
+
+  src = fetchFromGitHub {
+    owner = "launchbadge";
+    repo = "sqlx";
+    rev = "v${version}";
+    sha256 = "sha256-BYTAAzex3h9iEKFuPCyCXKokPLcgA0k9Zk6aMcWac+c=";
+  };
+
+  cargoSha256 = "sha256-3Fdoo8gvoLXe9fEAzKh7XY0LDVGsYsqB6NRlU8NqCMI=";
+
+  doCheck = false;
+  cargoBuildFlags = [ "-p sqlx-cli" ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = lib.optionals stdenv.isLinux [ openssl ]
+    ++ lib.optionals stdenv.isDarwin [ SystemConfiguration CoreFoundation Security libiconv ];
+
+  meta = with lib; {
+    description =
+      "SQLx's associated command-line utility for managing databases, migrations, and enabling offline mode with sqlx::query!() and friends.";
+    homepage = "https://github.com/launchbadge/sqlx";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ greizgh ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/rust/svd2rust/cargo-lock.patch b/nixpkgs/pkgs/development/tools/rust/svd2rust/cargo-lock.patch
new file mode 100644
index 000000000000..62dd8427c358
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/svd2rust/cargo-lock.patch
@@ -0,0 +1,493 @@
+diff --git a/Cargo.lock b/Cargo.lock
+new file mode 100644
+--- /dev/null
++++ b/Cargo.lock
+@@ -0,0 +1,488 @@
++# This file is automatically @generated by Cargo.
++# It is not intended for manual editing.
++version = 3
++
++[[package]]
++name = "aho-corasick"
++version = "0.7.18"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
++dependencies = [
++ "memchr",
++]
++
++[[package]]
++name = "ansi_term"
++version = "0.11.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
++dependencies = [
++ "winapi",
++]
++
++[[package]]
++name = "anyhow"
++version = "1.0.44"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1"
++
++[[package]]
++name = "atty"
++version = "0.2.14"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
++dependencies = [
++ "hermit-abi",
++ "libc",
++ "winapi",
++]
++
++[[package]]
++name = "autocfg"
++version = "1.0.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
++
++[[package]]
++name = "bitflags"
++version = "1.3.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
++
++[[package]]
++name = "cast"
++version = "0.2.7"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a"
++dependencies = [
++ "rustc_version",
++]
++
++[[package]]
++name = "cfg-if"
++version = "1.0.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
++
++[[package]]
++name = "clap"
++version = "2.33.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
++dependencies = [
++ "ansi_term",
++ "atty",
++ "bitflags",
++ "strsim",
++ "textwrap",
++ "unicode-width",
++ "vec_map",
++]
++
++[[package]]
++name = "clap_conf"
++version = "0.1.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "56039deda04adbf9af4e5595c199572dc276f4fe60b03a4c84c0186d4de649d8"
++dependencies = [
++ "anyhow",
++ "clap",
++ "serde",
++ "thiserror",
++ "toml",
++]
++
++[[package]]
++name = "crossbeam-channel"
++version = "0.5.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4"
++dependencies = [
++ "cfg-if",
++ "crossbeam-utils",
++]
++
++[[package]]
++name = "crossbeam-deque"
++version = "0.8.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
++dependencies = [
++ "cfg-if",
++ "crossbeam-epoch",
++ "crossbeam-utils",
++]
++
++[[package]]
++name = "crossbeam-epoch"
++version = "0.9.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd"
++dependencies = [
++ "cfg-if",
++ "crossbeam-utils",
++ "lazy_static",
++ "memoffset",
++ "scopeguard",
++]
++
++[[package]]
++name = "crossbeam-utils"
++version = "0.8.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db"
++dependencies = [
++ "cfg-if",
++ "lazy_static",
++]
++
++[[package]]
++name = "either"
++version = "1.6.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
++
++[[package]]
++name = "env_logger"
++version = "0.7.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
++dependencies = [
++ "atty",
++ "humantime",
++ "log",
++ "regex",
++ "termcolor",
++]
++
++[[package]]
++name = "hermit-abi"
++version = "0.1.19"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
++dependencies = [
++ "libc",
++]
++
++[[package]]
++name = "humantime"
++version = "1.3.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
++dependencies = [
++ "quick-error",
++]
++
++[[package]]
++name = "inflections"
++version = "1.1.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a"
++
++[[package]]
++name = "lazy_static"
++version = "1.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
++
++[[package]]
++name = "libc"
++version = "0.2.102"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103"
++
++[[package]]
++name = "log"
++version = "0.4.14"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
++dependencies = [
++ "cfg-if",
++]
++
++[[package]]
++name = "memchr"
++version = "2.4.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
++
++[[package]]
++name = "memoffset"
++version = "0.6.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"
++dependencies = [
++ "autocfg",
++]
++
++[[package]]
++name = "num_cpus"
++version = "1.13.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
++dependencies = [
++ "hermit-abi",
++ "libc",
++]
++
++[[package]]
++name = "once_cell"
++version = "1.8.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
++
++[[package]]
++name = "proc-macro2"
++version = "1.0.29"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d"
++dependencies = [
++ "unicode-xid",
++]
++
++[[package]]
++name = "quick-error"
++version = "1.2.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
++
++[[package]]
++name = "quote"
++version = "1.0.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
++dependencies = [
++ "proc-macro2",
++]
++
++[[package]]
++name = "rayon"
++version = "1.5.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90"
++dependencies = [
++ "autocfg",
++ "crossbeam-deque",
++ "either",
++ "rayon-core",
++]
++
++[[package]]
++name = "rayon-core"
++version = "1.9.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e"
++dependencies = [
++ "crossbeam-channel",
++ "crossbeam-deque",
++ "crossbeam-utils",
++ "lazy_static",
++ "num_cpus",
++]
++
++[[package]]
++name = "regex"
++version = "1.5.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
++dependencies = [
++ "aho-corasick",
++ "memchr",
++ "regex-syntax",
++]
++
++[[package]]
++name = "regex-syntax"
++version = "0.6.25"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
++
++[[package]]
++name = "rustc_version"
++version = "0.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
++dependencies = [
++ "semver",
++]
++
++[[package]]
++name = "scopeguard"
++version = "1.1.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
++
++[[package]]
++name = "semver"
++version = "1.0.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
++
++[[package]]
++name = "serde"
++version = "1.0.130"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
++
++[[package]]
++name = "strsim"
++version = "0.8.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
++
++[[package]]
++name = "svd-parser"
++version = "0.10.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "697e7645ad9f5311fe3d872d094b135627b1616aea9e1573dddd28ca522579b9"
++dependencies = [
++ "anyhow",
++ "once_cell",
++ "rayon",
++ "regex",
++ "thiserror",
++ "xmltree",
++]
++
++[[package]]
++name = "svd2rust"
++version = "0.19.0"
++dependencies = [
++ "anyhow",
++ "cast",
++ "clap",
++ "clap_conf",
++ "env_logger",
++ "inflections",
++ "log",
++ "proc-macro2",
++ "quote",
++ "svd-parser",
++ "syn",
++ "thiserror",
++]
++
++[[package]]
++name = "syn"
++version = "1.0.76"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "c6f107db402c2c2055242dbf4d2af0e69197202e9faacbef9571bbe47f5a1b84"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "unicode-xid",
++]
++
++[[package]]
++name = "termcolor"
++version = "1.1.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
++dependencies = [
++ "winapi-util",
++]
++
++[[package]]
++name = "textwrap"
++version = "0.11.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
++dependencies = [
++ "unicode-width",
++]
++
++[[package]]
++name = "thiserror"
++version = "1.0.29"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88"
++dependencies = [
++ "thiserror-impl",
++]
++
++[[package]]
++name = "thiserror-impl"
++version = "1.0.29"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "syn",
++]
++
++[[package]]
++name = "toml"
++version = "0.5.8"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
++dependencies = [
++ "serde",
++]
++
++[[package]]
++name = "unicode-width"
++version = "0.1.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
++
++[[package]]
++name = "unicode-xid"
++version = "0.2.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
++
++[[package]]
++name = "vec_map"
++version = "0.8.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
++
++[[package]]
++name = "winapi"
++version = "0.3.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
++dependencies = [
++ "winapi-i686-pc-windows-gnu",
++ "winapi-x86_64-pc-windows-gnu",
++]
++
++[[package]]
++name = "winapi-i686-pc-windows-gnu"
++version = "0.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
++
++[[package]]
++name = "winapi-util"
++version = "0.1.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
++dependencies = [
++ "winapi",
++]
++
++[[package]]
++name = "winapi-x86_64-pc-windows-gnu"
++version = "0.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
++
++[[package]]
++name = "xml-rs"
++version = "0.7.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "3c1cb601d29fe2c2ac60a2b2e5e293994d87a1f6fa9687a31a15270f909be9c2"
++dependencies = [
++ "bitflags",
++]
++
++[[package]]
++name = "xmltree"
++version = "0.8.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ff8eaee9d17062850f1e6163b509947969242990ee59a35801af437abe041e70"
++dependencies = [
++ "xml-rs",
++]
diff --git a/nixpkgs/pkgs/development/tools/rust/svd2rust/default.nix b/nixpkgs/pkgs/development/tools/rust/svd2rust/default.nix
new file mode 100644
index 000000000000..5f67b335bc35
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/svd2rust/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, rustPlatform, libiconv }:
+
+with rustPlatform;
+
+buildRustPackage rec {
+  pname = "svd2rust";
+  version = "0.19.0";
+
+  src = fetchFromGitHub {
+    owner = "rust-embedded";
+    repo = "svd2rust";
+    rev = "v${version}";
+    sha256 = "04mm0l7cv2q5yjxrkpr7p0kxd4nmi0d7m4l436q8p492nvgb75zx";
+  };
+  cargoPatches = [ ./cargo-lock.patch ];
+
+  cargoSha256 = "1v1qx0r3k86jipyaaggm25pinsqicmzvnzrxd0lr5xk77s1kvgid";
+
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
+
+  meta = with lib; {
+    description = "Generate Rust register maps (`struct`s) from SVD files";
+    homepage = "https://github.com/rust-embedded/svd2rust";
+    license = with licenses; [ mit asl20 ];
+  };
+}