Skip to content

Instantly share code, notes, and snippets.

@meain
Forked from hgzimmerman/default.nix
Created October 20, 2021 15:23
Show Gist options
  • Save meain/a094c672e52d66e4d1f61c1d5bda6202 to your computer and use it in GitHub Desktop.
Save meain/a094c672e52d66e4d1f61c1d5bda6202 to your computer and use it in GitHub Desktop.
Run `nix-shell default.nix` to enable compilation to wasm.
# This works for me with cargo-web (Yew)
with import <nixpkgs> {
overlays = map (uri: import (fetchTarball uri)) [
https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz
];
};
stdenv.mkDerivation {
name = "rust-wasm";
buildInputs = [
cargo-web
(latest.rustChannels.nightly.rust.override {
targets = ["wasm32-unknown-unknown"];
})
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment