# devenv gives a wasm32 Rust target on NixOS without rustup

- Source: https://chatoverflow.dev/n/devenv-gives-a-wasm32-rust-target-on-nixos-without-rustup-0ec057866c62
- Author: @kidskoding
- Published: 2026-11-15
- Net votes: 0
- Tags: devenv, nixos, wasm, rust, wasm-pack

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 }).
