2020-02-17 15:54:13 +00:00
|
|
|
{ lib, stdenv, fetchurl, writeText, jq, conf ? {} }:
|
2017-08-26 19:49:07 +01:00
|
|
|
|
2020-02-17 15:54:13 +00:00
|
|
|
let
|
2021-11-03 12:43:23 +00:00
|
|
|
pinData = lib.importJSON ./pin.json;
|
2020-02-17 15:54:13 +00:00
|
|
|
noPhoningHome = {
|
|
|
|
disable_guests = true; # disable automatic guest account registration at matrix.org
|
|
|
|
piwik = false; # disable analytics
|
|
|
|
};
|
2020-07-15 21:39:34 +01:00
|
|
|
configOverrides = writeText "element-config-overrides.json" (builtins.toJSON (noPhoningHome // conf));
|
2020-02-17 15:54:13 +00:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2020-07-15 21:39:34 +01:00
|
|
|
pname = "element-web";
|
2021-10-12 22:58:14 +01:00
|
|
|
inherit (pinData) version;
|
2017-08-26 19:49:07 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-12-09 11:27:03 +00:00
|
|
|
url = "https://github.com/vector-im/element-web/releases/download/v${version}/element-v${version}.tar.gz";
|
2021-10-12 22:58:14 +01:00
|
|
|
sha256 = pinData.webHash;
|
2017-08-26 19:49:07 +01:00
|
|
|
};
|
|
|
|
|
2020-02-17 15:54:13 +00:00
|
|
|
installPhase = ''
|
2019-12-10 14:54:05 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2017-08-26 19:49:07 +01:00
|
|
|
mkdir -p $out/
|
|
|
|
cp -R . $out/
|
2020-02-17 15:54:13 +00:00
|
|
|
${jq}/bin/jq -s '.[0] * .[1]' "config.sample.json" "${configOverrides}" > "$out/config.json"
|
2019-12-10 14:54:05 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2017-08-26 19:49:07 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A glossy Matrix collaboration client for the web";
|
2020-07-15 21:39:34 +01:00
|
|
|
homepage = "https://element.io/";
|
2021-04-26 19:01:34 +01:00
|
|
|
changelog = "https://github.com/vector-im/element-web/blob/v${version}/CHANGELOG.md";
|
2021-01-15 05:42:41 +00:00
|
|
|
maintainers = lib.teams.matrix.members;
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
platforms = lib.platforms.all;
|
2017-08-26 19:49:07 +01:00
|
|
|
hydraPlatforms = [];
|
|
|
|
};
|
|
|
|
}
|