Skip to content

Instantly share code, notes, and snippets.

@oxalica
Created January 16, 2021 14:49
Show Gist options
  • 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
];
};
}
);
}
@zopieux
Copy link

zopieux commented Feb 15, 2025

Pre-aggregated package rust is not encouraged for stable channel since it contains almost all and uncertain components.
Consider use default profile like rust-bin.stable.latest.default and override it with extensions you need.

rust-bin.stable.latest.rust.override
   ↓
rust-bin.stable.latest.default.override

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment