Skip to content

Instantly share code, notes, and snippets.

@notpeelz
Forked from lightdiscord/default.nix
Created April 4, 2020 20:35
Show Gist options
  • Save notpeelz/265142ed50f8ad773c90602e26ffe5d2 to your computer and use it in GitHub Desktop.
Save notpeelz/265142ed50f8ad773c90602e26ffe5d2 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