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