Skip to content

Instantly share code, notes, and snippets.

@oxalica
Created January 16, 2021 14:49
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save oxalica/310d9a1ba69fd10123f2d70dc6e00f0b to your computer and use it in GitHub Desktop.
Save oxalica/310d9a1ba69fd10123f2d70dc6e00f0b to your computer and use it in GitHub Desktop.
Rust wasm example development environment
{
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
flake-utils.url = github:numtide/flake-utils;
rust-overlay.url = github:oxalica/rust-overlay;
};
outputs = { nixpkgs, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachSystem ["x86_64-linux"] (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlay ];
};
in {
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
(rust-bin.stable.latest.rust.override {
targets = [ "wasm32-unknown-unknown" ];
})
wasm-pack
wasm-bindgen-cli
];
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment