about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--shells/rust.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/shells/rust.nix b/shells/rust.nix
index 74eafd4f3aaa..8bc6538bc4e1 100644
--- a/shells/rust.nix
+++ b/shells/rust.nix
@@ -1,17 +1,20 @@
-{ pkgs ? import ../. {} }:
-with pkgs;
+{ pkgs ? import ../. {} }: pkgs.callPackage (
+{ stdenv, cargo, cargo-deny, cargo-edit, clang, clippy, llvmPackages, pkg-config
+, rust-analyzer, rustPlatform, rustc, rustfmt,
+}:
 
 stdenv.mkDerivation {
   name = "rust-shell";
-  buildInputs = [
-    cargo cargo-deny cargo-edit clang clippy llvm pkg-config rust-analyzer rustc
-    rustfmt
+  nativeBuildInputs = [
+    cargo cargo-deny cargo-edit clang clippy llvmPackages.llvm pkg-config
+    rust-analyzer rustPlatform.cargoBuildHook rustc rustfmt
   ];
 
   buildCommand = ''
-    printf "%s\n" $buildInputs > $out
+    env > $out
   '';
 
   # For bindgen
   LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
 }
+) { }