2021-10-28 13:29:27 +01:00
|
|
|
{ stdenv, lib
|
|
|
|
, fetchgit
|
|
|
|
, fetchYarnDeps
|
|
|
|
, nodejs
|
|
|
|
, yarn
|
|
|
|
, fixup_yarn_lock
|
|
|
|
, writeText, jq, conf ? {}
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-11-03 12:43:23 +00:00
|
|
|
pinData = lib.importJSON ./pin.json;
|
2021-10-28 13:29:27 +01:00
|
|
|
noPhoningHome = {
|
|
|
|
disable_guests = true; # disable automatic guest account registration at matrix.org
|
|
|
|
};
|
|
|
|
configOverrides = writeText "element-config-overrides.json" (builtins.toJSON (noPhoningHome // conf));
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "schildichat-web";
|
|
|
|
inherit (pinData) version;
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/SchildiChat/schildichat-desktop/";
|
2022-02-25 12:56:23 +00:00
|
|
|
inherit (pinData) rev;
|
2021-10-28 13:29:27 +01:00
|
|
|
sha256 = pinData.srcHash;
|
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = src + "/element-web/yarn.lock";
|
|
|
|
sha256 = pinData.webYarnHash;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ yarn fixup_yarn_lock jq nodejs ];
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
|
|
|
|
export HOME=$PWD/tmp
|
|
|
|
mkdir -p $HOME
|
|
|
|
pushd element-web
|
|
|
|
yarn config --offline set yarn-offline-mirror $offlineCache
|
|
|
|
fixup_yarn_lock yarn.lock
|
|
|
|
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
|
|
|
|
rm -rf node_modules/matrix-react-sdk
|
|
|
|
patchShebangs node_modules/ ../matrix-react-sdk/scripts/
|
|
|
|
ln -s $PWD/../matrix-react-sdk node_modules/
|
|
|
|
ln -s $PWD/node_modules ../matrix-react-sdk/
|
|
|
|
popd
|
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
pushd matrix-react-sdk
|
|
|
|
node_modules/.bin/reskindex -h ../element-web/src/header
|
|
|
|
popd
|
|
|
|
|
|
|
|
pushd element-web
|
|
|
|
node scripts/copy-res.js
|
|
|
|
node_modules/.bin/reskindex -h ../element-web/src/header
|
|
|
|
node_modules/.bin/webpack --progress --mode production
|
|
|
|
popd
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mv element-web/webapp $out
|
|
|
|
jq -s '.[0] * .[1]' "configs/sc/config.json" "${configOverrides}" > "$out/config.json"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Matrix client / Element Web fork";
|
|
|
|
homepage = "https://schildi.chat/";
|
|
|
|
changelog = "https://github.com/SchildiChat/schildichat-desktop/releases";
|
2022-02-23 20:55:27 +00:00
|
|
|
maintainers = lib.teams.matrix.members ++ [ lib.maintainers.kloenk ];
|
2021-10-28 13:29:27 +01:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
}
|