1{ lib
2, fetchFromGitHub
3, fetchYarnDeps
4, mkYarnPackage
5, baseUrl ? null
6}:
7
8mkYarnPackage rec {
9 pname = "synapse-admin";
10 version = "0.8.7";
11 src = fetchFromGitHub {
12 owner = "Awesome-Technologies";
13 repo = pname;
14 rev = version;
15 sha256 = "sha256-kvQBzrCu1sgDccKhr0i2DgDmO5z6u6s+vw5KymttoK4=";
16 };
17
18 yarnLock = ./yarn.lock;
19 packageJSON = ./package.json;
20
21 offlineCache = fetchYarnDeps {
22 inherit yarnLock;
23 hash = "sha256-f0ilsF3lA+134qUaX96mdntjpR4gRlmtRIh/xEFhtXQ=";
24 };
25
26 NODE_ENV = "production";
27 ${if baseUrl != null then "REACT_APP_SERVER" else null} = baseUrl;
28
29 # error:0308010C:digital envelope routines::unsupported
30 NODE_OPTIONS = "--openssl-legacy-provider";
31
32 buildPhase = ''
33 runHook preBuild
34
35 export HOME=$(mktemp -d)
36 pushd deps/synapse-admin
37 mv node_modules node_modules.bak
38 cp -r $(readlink -f node_modules.bak) node_modules
39 chmod +w node_modules
40 yarn --offline run build
41 popd
42
43 runHook postBuild
44 '';
45
46 distPhase = ''
47 runHook preDist
48
49 mkdir -p $out
50 cp -r deps/synapse-admin/build/* $out
51
52 runHook postDist
53 '';
54
55 dontFixup = true;
56 dontInstall = true;
57
58 meta = with lib; {
59 description = "Admin UI for Synapse Homeservers";
60 homepage = "https://github.com/Awesome-Technologies/synapse-admin";
61 license = licenses.asl20;
62 platforms = platforms.all;
63 maintainers = with maintainers; [ mkg20001 ma27 ];
64 };
65}