Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wasm-pack flake for Rust #19

Open
winston0410 opened this issue Jan 25, 2022 · 0 comments
Open

Add wasm-pack flake for Rust #19

winston0410 opened this issue Jan 25, 2022 · 0 comments

Comments

@winston0410
Copy link
Contributor

I have a working flake for using wasm-pack in NixOS, but I am not sure if using rustc and rustup better than using rust-overlay like https://github.com/oxalica/rust-overlay. Any thoughts?

{
  description = "joli-string";

  outputs = { self, nixpkgs }:
    let system = "x86_64-linux";
    in {
      devShell.${system} = (({ pkgs, ... }:
        pkgs.mkShell {
          buildInputs = with pkgs; [
            wasm-pack
            cargo
            (rustc.override {
              stdenv = stdenv.override {
                targetPlatform = {
                  isRedox = false;
                  isMusl = false;
                  parsed = {
                    cpu = { name = "wasm32"; };
                    vendor = { name = "unknown"; };
                    kernel = { name = "unknown"; };
                    abi = { name = "unknown"; };
                  };
                };
              };
            })
            rustup
          ];

          shellHook = "";
        }) { pkgs = nixpkgs.legacyPackages.${system}; });
    };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant