about summary refs log blame commit diff
path: root/users/kranzes/wasm-hello-world/default.nix
blob: 0970f955defffa4f587c32c791a34f3427bf2f1e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                                           
{ pkgs, lib, ... }:

(pkgs.pkgsCross.wasm32-unknown-none.callPackage ./Cargo.nix { }).rootCrate.build.overrideAttrs (oldAttrs: {
  installPhase = ''
    ${lib.getExe pkgs.wasm-bindgen-cli} \
      --target web \
      --out-dir $out \
      --out-name ${oldAttrs.crateName} \
      --no-typescript \
      target/lib/${oldAttrs.crateName}-${oldAttrs.metadata}.wasm

      mv src/*.html $out
  '';
})