bandwhich: 0.23.0 -> 0.23.1; move to by-name; nixfmt; useFetchCargoVendor (#356934)
[NixPkgs.git] / pkgs / by-name / sy / synapse-admin / package.nix
blobe3423b60cf218edfa39d758157cdee339e1d0c18
2   lib,
3   fetchFromGitHub,
4   fetchYarnDeps,
5   mkYarnPackage,
6   baseUrl ? null,
7   writeShellScriptBin,
8 }:
10 mkYarnPackage rec {
11   pname = "synapse-admin";
12   version = "0.10.0";
13   src = fetchFromGitHub {
14     owner = "Awesome-Technologies";
15     repo = pname;
16     rev = version;
17     sha256 = "sha256-3MC5PCEwYfZzJy9AW9nHTpvU49Lk6wbYC4Rcv9J9MEg=";
18   };
20   packageJSON = ./package.json;
22   offlineCache = fetchYarnDeps {
23     yarnLock = "${src}/yarn.lock";
24     hash = "sha256-vpCwPL1B+hbIaVSHtlkGjPAteu9BFNNmCTE66CSyFkg=";
25   };
27   nativeBuildInputs = [
28     (writeShellScriptBin "git" "echo ${version}")
29   ];
31   NODE_ENV = "production";
32   ${if baseUrl != null then "REACT_APP_SERVER" else null} = baseUrl;
34   # error:0308010C:digital envelope routines::unsupported
35   NODE_OPTIONS = "--openssl-legacy-provider";
37   buildPhase = ''
38     runHook preBuild
40     export HOME=$(mktemp -d)
41     yarn --offline run build
43     runHook postBuild
44   '';
46   distPhase = ''
47     runHook preDist
49     cp -r deps/synapse-admin/dist $out
51     runHook postDist
52   '';
54   dontFixup = true;
55   dontInstall = true;
57   meta = with lib; {
58     description = "Admin UI for Synapse Homeservers";
59     homepage = "https://github.com/Awesome-Technologies/synapse-admin";
60     license = licenses.asl20;
61     platforms = platforms.all;
62     maintainers = with maintainers; [
63       mkg20001
64       ma27
65     ];
66   };