build-support/vm: don't depend on the "unix" module (#375355)
[NixPkgs.git] / pkgs / by-name / go / gotify-server / ui.nix
blob104b5670b9943e427bc7fea46dbfac1b8f086917
2   stdenv,
3   yarn,
4   fixup-yarn-lock,
5   nodejs-slim,
6   fetchYarnDeps,
7   gotify-server,
8 }:
10 stdenv.mkDerivation rec {
11   pname = "gotify-ui";
12   inherit (gotify-server) version;
14   src = gotify-server.src + "/ui";
16   offlineCache = fetchYarnDeps {
17     yarnLock = "${src}/yarn.lock";
18     hash = "sha256-ejHzo6NHCMlNiYePWvfMY9Blb58pj3UQ5PFI0V84flI=";
19   };
21   nativeBuildInputs = [
22     yarn
23     fixup-yarn-lock
24     nodejs-slim
25   ];
27   postPatch = ''
28     export HOME=$NIX_BUILD_TOP/fake_home
29     yarn config --offline set yarn-offline-mirror $offlineCache
30     fixup-yarn-lock yarn.lock
31     yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive
32     patchShebangs node_modules/
33   '';
35   buildPhase = ''
36     runHook preBuild
38     export NODE_OPTIONS=--openssl-legacy-provider
39     yarn --offline build
41     runHook postBuild
42   '';
44   installPhase = ''
45     runHook preInstall
47     mv build $out
49     runHook postInstall
50   '';