Skip to content

Instantly share code, notes, and snippets.

@lightdiscord
Last active October 13, 2022 04:41
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save lightdiscord/aa8cb8e67ec9efbf9b20a9a3e9ebd007 to your computer and use it in GitHub Desktop.
Save lightdiscord/aa8cb8e67ec9efbf9b20a9a3e9ebd007 to your computer and use it in GitHub Desktop.
Rust and wasm with nixos

Rust, wasm and Nixos.

🦀 + 🕸 + ❄ = 💖


Instructions

$ nix-shell default.nix

$ # Then you can run any cargo-web command. (You need to specify the target)
$ cargo-web build --target=wasm32-unknown-unknown
$ cargo-web start --target=wasm32-unknown-unknown
$ cargo-web deploy --target=wasm32-unknown-unknown

See Also

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