From 71ed23142c5ab6db05263b6e5c52f8fab1d84425 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Fri, 5 Feb 2021 13:30:26 +0100 Subject: replace sed with replace-literal; add option for default map --- front/default.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/front/default.nix b/front/default.nix index 6a0f087..00db42c 100644 --- a/front/default.nix +++ b/front/default.nix @@ -4,6 +4,7 @@ , workadventure-messages , yarn2nix-moretea , lib +, replace , environment ? {} , ... }: @@ -27,7 +28,8 @@ let // envVar "TURN_USER" // envVar "TURN_PASSWORD" // envVar "JITSI_URL" - // envVar "JITSI_PRIVATE_MODE"; + // envVar "JITSI_PRIVATE_MODE" + // envVar "DEFAULT_MAP_URL"; in yarn2nix-moretea.mkYarnPackage (rec { pname = "workadventurefront"; version = "unstable"; @@ -44,18 +46,14 @@ in yarn2nix-moretea.mkYarnPackage (rec { # NOTE: this is optional and generated dynamically if omitted yarnNix = ./yarn.nix; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ makeWrapper replace ]; dontStrip = true; - - # can't currently change stun server as chaski.stuebinm.eu doesn't seem to work? -# find . -name '*.ts' -exec sed -i "s/urls: 'stun:stun.l.google.com:19302'/url: 'chaski.stuebinm.eu:3478',credential:'chaski',username:'chaski'/g" {} + patchPhase = '' # remove google tag manager - find . -name '*.html' -exec sed -i "s/' ' ' + '' + (if envVars ? DEFAULT_MAP_URL then ''replace-literal -efs -r -x .ts "/Floor0/floor0.json" "${envVars.DEFAULT_MAP_URL}"'' else ""); buildPhase = '' mkdir -p $out -- cgit v1.2.3