3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/instant-messengers/element/element-web.nix

40 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, writeText, jq, conf ? {} }:
2017-08-26 19:49:07 +01:00
let
pinData = lib.importJSON ./pin.json;
noPhoningHome = {
disable_guests = true; # disable automatic guest account registration at matrix.org
piwik = false; # disable analytics
};
configOverrides = writeText "element-config-overrides.json" (builtins.toJSON (noPhoningHome // conf));
in stdenv.mkDerivation rec {
pname = "element-web";
inherit (pinData) version;
2017-08-26 19:49:07 +01:00
src = fetchurl {
url = "https://github.com/vector-im/element-web/releases/download/v${version}/element-v${version}.tar.gz";
sha256 = pinData.webHash;
2017-08-26 19:49:07 +01: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/
${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";
homepage = "https://element.io/";
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 = [];
};
}