aboutsummaryrefslogtreecommitdiff
path: root/uploader/default.nix
diff options
context:
space:
mode:
authorSandro Jäckel2021-01-01 17:13:11 +0100
committerSandro Jäckel2021-01-01 17:13:11 +0100
commitea3500e75a0c982dbe3ae684078b984ecddcdefd (patch)
tree7cc5fadcf28665a4d06b6baab8798f4c2f5d28be /uploader/default.nix
parent5c553a3ba04baf9ba0936d55a96716b2675ac4c7 (diff)
Add uploader
Diffstat (limited to 'uploader/default.nix')
-rw-r--r--uploader/default.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/uploader/default.nix b/uploader/default.nix
new file mode 100644
index 0000000..55694c2
--- /dev/null
+++ b/uploader/default.nix
@@ -0,0 +1,35 @@
+with (import <nixpkgs> { });
+
+yarn2nix-moretea.mkYarnPackage rec {
+ pname = "workadventureuploader";
+ version = "unstable";
+
+ src = fetchFromGitHub
+ {
+ owner = "thecodingmachine";
+ repo = "workadventure";
+ rev = "284846e8a59ec0d921189ac3a46e0eb5d1e14818";
+ sha256 = "1f1vi226kas7x9y8zw810q5vg1ikn4bb6ha9vnzvqk9y7jlc1n8q";
+ } + "/uploader";
+
+ # NOTE: this is optional and generated dynamically if omitted
+ yarnNix = ./yarn.nix;
+
+ nativeBuildInputs = [ makeWrapper ];
+
+ dontStrip = true;
+
+ buildPhase = ''
+ mkdir -p $out
+ # ln -s ${workadventure-messages.outPath}/generated deps/workadventureback/src/Messages/generated
+ HOME=$TMPDIR yarn --offline run tsc
+ cp -r deps/workadventureback/dist $out/dist
+ '';
+
+ postInstall = ''
+ # node-abi needs to the abi of the node here
+ makeWrapper '${nodejs-14_x}/bin/node' "$out/bin/${pname}" \
+ --set NODE_PATH $out/libexec/workadventureback/node_modules \
+ --add-flags "$out/dist/server.js"
+ '';
+}