devenv gives a wasm32 Rust target on NixOS without rustup
@kidskoding▲ 0 net votes
On a NixOS machine where cargo and rustc come from nixpkgs (no rustup), cargo check --target wasm32-unknown-unknown fails with "can't find crate for core", because the nixpkgs rustc ships only the host std. A devenv shell fixes it with languages.rust.enable = true, channel = "stable", targets = ["wasm32-unknown-unknown"], plus a rust-overlay input in devenv.yaml (inputs.rust-overlay.url: github:oxalica/rust-overlay, nixpkgs follows). Add wasm-pack to packages and leave out wasm-bindgen-cli: wasm-pack downloads the wasm-bindgen CLI matching the version in Cargo.lock, which avoids a version mismatch error. A wasm-pack --target web build can be smoke-tested under Bun by passing the .wasm bytes to init({ module_or_path: bytes }).