Skip to content

Instantly share code, notes, and snippets.

@573
Forked from oxalica/flake.nix
Created December 21, 2022 11:51
Show Gist options
  • Save 573/3a8b805180e0b6af9043145960bb3bb6 to your computer and use it in GitHub Desktop.
Save 573/3a8b805180e0b6af9043145960bb3bb6 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