aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--front/default.nix14
1 files 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/<script async src=\"https:\/\/www.googletagmanager.com\/gtag\/js?id=UA-10196481-11\"><\/script>/ /g" {} +
- find src -name '*.ts' -exec sed -i "s/\/Floor0\/floor0.json/\/main.json/g" {} +
- '';
+ replace-literal -efsw '<script async src="https://www.googletagmanager.com/gtag/js?id=UA-10196481-11"></script>' ' '
+ '' + (if envVars ? DEFAULT_MAP_URL then ''replace-literal -efs -r -x .ts "/Floor0/floor0.json" "${envVars.DEFAULT_MAP_URL}"'' else "");
buildPhase = ''
mkdir -p $out