Skip to content

Instantly share code, notes, and snippets.

@hgzimmerman
Created November 1, 2018 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hgzimmerman/e0cc6e1ba3c48fcbc345fc9ae6cf01e4 to your computer and use it in GitHub Desktop.
Save hgzimmerman/e0cc6e1ba3c48fcbc345fc9ae6cf01e4 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