From 7835d1341c6cb03bb6b76a693bdc9a6c9981af78 Mon Sep 17 00:00:00 2001 From: Mewp Date: Sun, 10 Jan 2021 15:51:31 +0100 Subject: Make the front package configurable. --- front/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/front/default.nix b/front/default.nix index 057855e..ea49c0f 100644 --- a/front/default.nix +++ b/front/default.nix @@ -3,7 +3,8 @@ , makeWrapper , workadventure-messages , yarn2nix-moretea -, ... }: +, lib +, ... } @ args: yarn2nix-moretea.mkYarnPackage rec { pname = "workadventurefront"; version = "unstable"; @@ -32,4 +33,8 @@ yarn2nix-moretea.mkYarnPackage rec { distPhase = ":"; installPhase = ":"; -} +} // lib.getAttrs [ + "DEBUG_MODE" "API_URL" "UPLOADER_URL" "ADMIN_URL" + "API_PROTOCOL" "UPLOADER_PROTOCOL" "ADMIN_PROTOCOL" + "TURN_SERVER" "TURN_USER" "TURN_PASSWORD" + "JITSI_URL" "JITSI_PRIVATE_MODE" ] args -- cgit v1.2.3 From 09e8c81cc18f4781f59d22dd8ab1654c5b846de2 Mon Sep 17 00:00:00 2001 From: Mewp Date: Sun, 10 Jan 2021 16:51:48 +0100 Subject: Use a different approach for passing env vars. --- front/default.nix | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/front/default.nix b/front/default.nix index ea49c0f..ecb5afb 100644 --- a/front/default.nix +++ b/front/default.nix @@ -4,8 +4,25 @@ , workadventure-messages , yarn2nix-moretea , lib -, ... } @ args: -yarn2nix-moretea.mkYarnPackage rec { +, environment ? {} +, ... }: + +let + envVar = (name: lib.optionalAttrs (environment ? name) { name = environment.${name}; }); + + envVars = envVar "DEBUG_MODE" + // envVar "API_URL" + // envVar "UPLOADER_URL" + // envVar "ADMIN_URL" + // envVar "API_PROTOCOL" + // envVar "UPLOADER_PROTOCOL" + // envVar "ADMIN_PROTOCOL" + // envVar "TURN_SERVER" + // envVar "TURN_USER" + // envVar "TURN_PASSWORD" + // envVar "JITSI_URL" + // envVar "JITSI_PRIVATE_MODE"; +in yarn2nix-moretea.mkYarnPackage (rec { pname = "workadventurefront"; version = "unstable"; @@ -33,8 +50,4 @@ yarn2nix-moretea.mkYarnPackage rec { distPhase = ":"; installPhase = ":"; -} // lib.getAttrs [ - "DEBUG_MODE" "API_URL" "UPLOADER_URL" "ADMIN_URL" - "API_PROTOCOL" "UPLOADER_PROTOCOL" "ADMIN_PROTOCOL" - "TURN_SERVER" "TURN_USER" "TURN_PASSWORD" - "JITSI_URL" "JITSI_PRIVATE_MODE" ] args +} // envVars) -- cgit v1.2.3 From 0f3b3d4807b674d7f7ec83ab347f84839a87ffce Mon Sep 17 00:00:00 2001 From: Mewp Date: Sun, 10 Jan 2021 23:55:57 +0100 Subject: Fix front env vars. Update env to a working WA version. --- front/default.nix | 18 ++++++++++++------ front/yarn.nix | 16 ++++++++-------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/front/default.nix b/front/default.nix index ecb5afb..d3276e7 100644 --- a/front/default.nix +++ b/front/default.nix @@ -1,5 +1,5 @@ { stdenv -, fetchFromGitHub +, fetchFromGitLab , makeWrapper , workadventure-messages , yarn2nix-moretea @@ -8,15 +8,21 @@ , ... }: let - envVar = (name: lib.optionalAttrs (environment ? name) { name = environment.${name}; }); + envVar = (name: lib.optionalAttrs (environment ? ${name}) { ${name} = environment.${name}; }); envVars = envVar "DEBUG_MODE" // envVar "API_URL" // envVar "UPLOADER_URL" // envVar "ADMIN_URL" + // envVar "MAPS_URL" + // envVar "API_HOST" + // envVar "UPLOADER_HOST" + // envVar "ADMIN_HOST" + // envVar "MAPS_HOST" // envVar "API_PROTOCOL" // envVar "UPLOADER_PROTOCOL" // envVar "ADMIN_PROTOCOL" + // envVar "MAPS_PROTOCOL" // envVar "TURN_SERVER" // envVar "TURN_USER" // envVar "TURN_PASSWORD" @@ -26,12 +32,12 @@ in yarn2nix-moretea.mkYarnPackage (rec { pname = "workadventurefront"; version = "unstable"; - src = fetchFromGitHub + src = fetchFromGitLab { - owner = "thecodingmachine"; + owner = "fediventure"; repo = "workadventure"; - rev = "284846e8a59ec0d921189ac3a46e0eb5d1e14818"; - sha256 = "1f1vi226kas7x9y8zw810q5vg1ikn4bb6ha9vnzvqk9y7jlc1n8q"; + rev = "e77551c629b0412c808843f91d072a4ce7558d7f"; + sha256 = "1ikasdk2qhsrnh8x9sxvyjhzdiwmzimgs523cqysasz312yv4dfk"; } + "/front"; # NOTE: this is optional and generated dynamically if omitted diff --git a/front/yarn.nix b/front/yarn.nix index 02533a2..f094242 100644 --- a/front/yarn.nix +++ b/front/yarn.nix @@ -674,11 +674,11 @@ }; } { - name = "axios___axios_0.20.0.tgz"; + name = "axios___axios_0.21.1.tgz"; path = fetchurl { - name = "axios___axios_0.20.0.tgz"; - url = "https://registry.yarnpkg.com/axios/-/axios-0.20.0.tgz"; - sha1 = "057ba30f04884694993a8cd07fa394cff11c50bd"; + name = "axios___axios_0.21.1.tgz"; + url = "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz"; + sha1 = "22563481962f4d6bde9a76d516ef0e5d3c09b2b8"; }; } { @@ -4090,11 +4090,11 @@ }; } { - name = "phaser___phaser_3.24.1.tgz"; + name = "phaser___phaser_3.51.0.tgz"; path = fetchurl { - name = "phaser___phaser_3.24.1.tgz"; - url = "https://registry.yarnpkg.com/phaser/-/phaser-3.24.1.tgz"; - sha1 = "376e0c965d2a35af37c06ee78627dafbde5be017"; + name = "phaser___phaser_3.51.0.tgz"; + url = "https://registry.yarnpkg.com/phaser/-/phaser-3.51.0.tgz"; + sha1 = "b0c7ee2b21e795830d74f476dd30816a42b023bd"; }; } { -- cgit v1.2.3 From a76cd83752bebff7a271534b49ce15cb16145051 Mon Sep 17 00:00:00 2001 From: Mewp Date: Mon, 11 Jan 2021 03:17:51 +0100 Subject: Update the front package --- front/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/default.nix b/front/default.nix index d3276e7..43eb919 100644 --- a/front/default.nix +++ b/front/default.nix @@ -36,8 +36,8 @@ in yarn2nix-moretea.mkYarnPackage (rec { { owner = "fediventure"; repo = "workadventure"; - rev = "e77551c629b0412c808843f91d072a4ce7558d7f"; - sha256 = "1ikasdk2qhsrnh8x9sxvyjhzdiwmzimgs523cqysasz312yv4dfk"; + rev = "1bcf0757fd5203132edd17fc806d81e7699111a7"; + sha256 = "0wwgfrcrpimpxjhk073yxlkcp1p0bn0glxd9wisyq5kv8s7jw1yz"; } + "/front"; # NOTE: this is optional and generated dynamically if omitted -- cgit v1.2.3