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(-) (limited to 'front/default.nix') 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