diff options
author | stuebinm | 2021-02-05 13:30:26 +0100 |
---|---|---|
committer | stuebinm | 2021-02-05 13:30:26 +0100 |
commit | 71ed23142c5ab6db05263b6e5c52f8fab1d84425 (patch) | |
tree | 2b95bc1369f7ee604e49d225addd4f31bbcfed0e /front | |
parent | 8899fcfbb665aba4a19513ea48ec16b27b705579 (diff) |
replace sed with replace-literal; add option for default map
Diffstat (limited to '')
-rw-r--r-- | front/default.nix | 14 |
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 |