32 lines
609 B
Nix
32 lines
609 B
Nix
{
|
|
pkgs ? import <nixpkgs> { },
|
|
}:
|
|
|
|
let
|
|
rust-toolchain = pkgs.rust-bin.stable."1.73.0".default;
|
|
|
|
rust-with-wasm-target = rust-toolchain.override {
|
|
targets = [ "wasm32-unknown-unknown" ];
|
|
};
|
|
|
|
in
|
|
pkgs.mkShell {
|
|
buildInputs = with pkgs; [
|
|
rust-with-wasm-target
|
|
|
|
wasm-bindgen-cli
|
|
wasm-pack
|
|
|
|
bun
|
|
clang
|
|
pkg-config
|
|
openssl
|
|
];
|
|
|
|
shellHook = ''
|
|
# Set the linker for the wasm target to clang to avoid potential issues
|
|
export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER="${pkgs.clang}/bin/clang"
|
|
echo "Nix shell is ready with Cargo, wasm-bindgen, and Bun."
|
|
'';
|
|
}
|