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.
This commit is contained in:
Harald Hoyer 2024-12-20 09:03:01 +01:00
parent b066cdd15a
commit 34a00bc5bd
Signed by: harald
GPG key ID: F519A1143B3FBE32

View file

@ -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