Merge pull request #196885 from linsui/element-web
This commit is contained in:
commit
5ff52d0441
1 changed files with 77 additions and 57 deletions
|
@ -18,9 +18,8 @@ let
|
||||||
disable_guests = true; # disable automatic guest account registration at matrix.org
|
disable_guests = true; # disable automatic guest account registration at matrix.org
|
||||||
piwik = false; # disable analytics
|
piwik = false; # disable analytics
|
||||||
};
|
};
|
||||||
configOverrides = writeText "element-config-overrides.json" (builtins.toJSON (noPhoningHome // conf));
|
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
unwrapped = stdenv.mkDerivation rec {
|
||||||
pname = "element-web";
|
pname = "element-web";
|
||||||
inherit (pinData) version;
|
inherit (pinData) version;
|
||||||
|
|
||||||
|
@ -74,7 +73,7 @@ in stdenv.mkDerivation rec {
|
||||||
cp -R webapp $out
|
cp -R webapp $out
|
||||||
cp ${jitsi-meet}/libs/external_api.min.js $out/jitsi_external_api.min.js
|
cp ${jitsi-meet}/libs/external_api.min.js $out/jitsi_external_api.min.js
|
||||||
echo "${version}" > "$out/version"
|
echo "${version}" > "$out/version"
|
||||||
jq -s '.[0] * .[1]' "config.sample.json" "${configOverrides}" > "$out/config.json"
|
jq -s '.[0] * $conf' "config.sample.json" --argjson "conf" '${builtins.toJSON noPhoningHome}' > "$out/config.json"
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
@ -87,4 +86,25 @@ in stdenv.mkDerivation rec {
|
||||||
license = lib.licenses.asl20;
|
license = lib.licenses.asl20;
|
||||||
platforms = lib.platforms.all;
|
platforms = lib.platforms.all;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
if (conf == { }) then unwrapped else
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "${unwrapped.pname}-wrapped";
|
||||||
|
inherit (unwrapped) version meta;
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ jq ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out
|
||||||
|
ln -s ${unwrapped}/* $out
|
||||||
|
rm $out/config.json
|
||||||
|
jq -s '.[0] * $conf' "${unwrapped}/config.json" --argjson "conf" '${builtins.toJSON conf}' > "$out/config.json"
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue