blob: 015c44e428bd1db2a0934b90d0d8b72d60f806bb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
{ stdenv, lib
, fetchgit
, fetchYarnDeps
, nodejs
, yarn
, fixup_yarn_lock
, writeText, jq, conf ? {}
}:
let
pinData = builtins.fromJSON (builtins.readFile ./pin.json);
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/";
rev = "v${version}";
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";
maintainers = lib.teams.matrix.members;
license = lib.licenses.asl20;
platforms = lib.platforms.all;
};
}
|