aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/applications/networking/instant-messengers/element/element-web.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/instant-messengers/element/element-web.nix')
-rw-r--r--nixpkgs/pkgs/applications/networking/instant-messengers/element/element-web.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/element/element-web.nix b/nixpkgs/pkgs/applications/networking/instant-messengers/element/element-web.nix
new file mode 100644
index 00000000000..3130c2cac46
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/instant-messengers/element/element-web.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, writeText, jq, conf ? {} }:
+
+# Note for maintainers:
+# Versions of `element-web` and `element-desktop` should be kept in sync.
+
+let
+ 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";
+ version = "1.7.7";
+
+ src = fetchurl {
+ url = "https://github.com/vector-im/riot-web/releases/download/v${version}/riot-v${version}.tar.gz";
+ sha256 = "1hly102725qh4xjggxv85w1hyq26mhkgj3y6s76yar7i3smj6kpw";
+ };
+
+ installPhase = ''
+ runHook preInstall
+
+ mkdir -p $out/
+ cp -R . $out/
+ ${jq}/bin/jq -s '.[0] * .[1]' "config.sample.json" "${configOverrides}" > "$out/config.json"
+
+ runHook postInstall
+ '';
+
+ meta = {
+ description = "A glossy Matrix collaboration client for the web";
+ homepage = "https://element.io/";
+ maintainers = stdenv.lib.teams.matrix.members;
+ license = stdenv.lib.licenses.asl20;
+ platforms = stdenv.lib.platforms.all;
+ hydraPlatforms = [];
+ };
+}