aboutsummaryrefslogtreecommitdiff
path: root/front
diff options
context:
space:
mode:
authorMewp2021-01-10 16:51:48 +0100
committerMewp2021-01-10 16:51:48 +0100
commit09e8c81cc18f4781f59d22dd8ab1654c5b846de2 (patch)
tree9e3be767d9eac7bf75fc6ac15d14b26c4de92bee /front
parent7835d1341c6cb03bb6b76a693bdc9a6c9981af78 (diff)
Use a different approach for passing env vars.
Diffstat (limited to '')
-rw-r--r--front/default.nix27
1 files 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)