summaryrefslogtreecommitdiff
path: root/.nix
diff options
context:
space:
mode:
Diffstat (limited to '.nix')
-rw-r--r--.nix/derivation.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/.nix/derivation.nix b/.nix/derivation.nix
new file mode 100644
index 0000000..c3f76a3
--- /dev/null
+++ b/.nix/derivation.nix
@@ -0,0 +1,29 @@
+{ lib
+, stdenv
+}:
+
+stdenv.mkDerivation {
+ pname = "kel_lights_out";
+ version = "0.0.0";
+
+ src = ./..;
+
+ dontConfigure = true;
+ buildPhase = ''
+ HOME=$(pwd)
+ emcc c++/lights_out.cpp \
+ -s WASM=1 \
+ -s EXPORTED_FUNCTIONS='["_fake_main"]' \
+ -s EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' \
+ -o lights_out.js
+ '';
+
+ # Silence the warnings for now
+ checkPhase = ''
+ '';
+
+ installPhase = ''
+ mkdir -p $out
+ cp lights_out.{wasm,js} $out/
+ '';
+}