pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / servers / gotify / ui.nix
blob7d43e219ccf12cebdb21e018af697b686d08075b
1 { stdenv
2 , yarn
3 , fixup-yarn-lock
4 , nodejs-slim
5 , fetchYarnDeps
6 , gotify-server
7 }:
9 stdenv.mkDerivation rec {
10   pname = "gotify-ui";
11   inherit (gotify-server) version;
13   src = gotify-server.src + "/ui";
15   offlineCache = fetchYarnDeps {
16     yarnLock = "${src}/yarn.lock";
17     hash = "sha256-ejHzo6NHCMlNiYePWvfMY9Blb58pj3UQ5PFI0V84flI=";
18   };
20   nativeBuildInputs = [ yarn fixup-yarn-lock nodejs-slim ];
22   postPatch = ''
23     export HOME=$NIX_BUILD_TOP/fake_home
24     yarn config --offline set yarn-offline-mirror $offlineCache
25     fixup-yarn-lock yarn.lock
26     yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive
27     patchShebangs node_modules/
28   '';
30   buildPhase = ''
31     runHook preBuild
33     export NODE_OPTIONS=--openssl-legacy-provider
34     yarn --offline build
36     runHook postBuild
37   '';
39   installPhase = ''
40     runHook preInstall
42     mv build $out
44     runHook postInstall
45   '';