From 34a00bc5bdaafe3bfc1db8328707534256eb275a Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 20 Dec 2024 09:03:01 +0100 Subject: [PATCH] feat(shell): enhance teepot shell with Rust tools support - Add rustfmt, clippy, and rust-src as extensions in the Rust toolchain. - Include bindgenHook and pkg-config in nativeBuildInputs for improved build support. - Set RUST_SRC_PATH for better Rust library integration. --- shells/teepot/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shells/teepot/default.nix b/shells/teepot/default.nix index 7055b44..effb413 100644 --- a/shells/teepot/default.nix +++ b/shells/teepot/default.nix @@ -9,10 +9,23 @@ , cargo-release , nixsgx , stdenv +, teepotCrate +, pkg-config }: +let + toolchain_with_src = (teepotCrate.rustVersion.override { + extensions = [ "rustfmt" "clippy" "rust-src" ]; + }); +in mkShell { inputsFrom = [ teepot.teepot ]; + nativeBuildInputs = [ + toolchain_with_src + pkg-config + teepotCrate.rustPlatform.bindgenHook + ]; + packages = [ dive taplo @@ -28,6 +41,7 @@ mkShell { QCNL_CONF_PATH = "${nixsgx.sgx-dcap.default_qpl}/etc/sgx_default_qcnl.conf"; OPENSSL_NO_VENDOR = "1"; + RUST_SRC_PATH = "${toolchain_with_src}/lib/rustlib/src/rust/library"; shellHook = '' if [ "x$NIX_LD" = "x" ]; then