Files
minimax/shell.nix
2025-11-03 17:12:44 -08:00

33 lines
670 B
Nix

{
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
cargo
rustc
(rust-std.override {
targets = [ "wasm32-unknown-unknown" ];
})
wasm-bindgen-cli
wasm-pack
bun
clang
pkg-config
openssl
];
shellHook = ''
# Set the linker for the wasm target to clang to avoid potential issues on NixOS
export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER="${pkgs.clang}/bin/clang"
# The rust-src path is needed by some tools like rust-analyzer
export RUST_SRC_PATH="${pkgs.rustPlatform.rustLibSrc}"
echo "Nix shell is ready with Rust (wasm target), wasm-bindgen, and Bun."
'';
}