15 pinData = import ./pin.nix;
16 inherit (pinData.hashes) webSrcHash webYarnHash;
18 disable_guests = true; # disable automatic guest account registration at matrix.org
21 stdenv.mkDerivation (finalAttrs: builtins.removeAttrs pinData [ "hashes" ] // {
22 pname = "element-web";
24 src = fetchFromGitHub {
26 repo = finalAttrs.pname;
27 rev = "v${finalAttrs.version}";
31 offlineCache = fetchYarnDeps {
32 yarnLock = finalAttrs.src + "/yarn.lock";
36 nativeBuildInputs = [ yarn fixup-yarn-lock jq nodejs ];
41 export VERSION=${finalAttrs.version}
42 yarn --offline build:res
43 yarn --offline build:module_system
44 yarn --offline build:bundle
53 # with the update of openssl3, some key ciphers are not supported anymore
54 # this flag will allow those codecs again as a workaround
55 # see https://medium.com/the-node-js-collection/node-js-17-is-here-8dba1e14e382#5f07
56 # and https://github.com/vector-im/element-web/issues/21043
57 export NODE_OPTIONS=--openssl-legacy-provider
60 fixup-yarn-lock yarn.lock
61 yarn config --offline set yarn-offline-mirror $offlineCache
62 yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
63 patchShebangs node_modules
72 cp ${jitsi-meet}/libs/external_api.min.js $out/jitsi_external_api.min.js
73 echo "${finalAttrs.version}" > "$out/version"
74 jq -s '.[0] * $conf' "config.sample.json" --argjson "conf" '${builtins.toJSON noPhoningHome}' > "$out/config.json"
80 description = "A glossy Matrix collaboration client for the web";
81 homepage = "https://element.io/";
82 changelog = "https://github.com/vector-im/element-web/blob/v${finalAttrs.version}/CHANGELOG.md";
83 maintainers = lib.teams.matrix.members;
84 license = lib.licenses.asl20;
85 platforms = lib.platforms.all;