about summary refs log tree commit diff
path: root/users/kranzes/wasm-hello-world/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/kranzes/wasm-hello-world/default.nix')
-rw-r--r--users/kranzes/wasm-hello-world/default.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/users/kranzes/wasm-hello-world/default.nix b/users/kranzes/wasm-hello-world/default.nix
new file mode 100644
index 000000000000..0970f955deff
--- /dev/null
+++ b/users/kranzes/wasm-hello-world/default.nix
@@ -0,0 +1,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
+  '';
+})
+