nixpkgs/pkgs/servers/gotify/ui.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
949 B
Nix
Raw Normal View History

2023-09-06 12:11:16 +02:00
{ stdenv
, yarn
, fixup_yarn_lock
, nodejs-slim
, fetchFromGitHub
2023-09-06 04:42:25 +02:00
, fetchYarnDeps
2023-09-06 12:11:16 +02:00
, gotify-server
2019-10-05 09:46:51 +02:00
}:
2023-09-06 12:11:16 +02:00
stdenv.mkDerivation rec {
pname = "gotify-ui";
2023-09-06 12:11:16 +02:00
inherit (gotify-server) version;
2019-10-05 09:46:51 +02:00
2023-09-06 12:11:16 +02:00
src = gotify-server.src + "/ui";
2023-09-06 04:42:25 +02:00
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-ejHzo6NHCMlNiYePWvfMY9Blb58pj3UQ5PFI0V84flI=";
};
2019-10-05 09:46:51 +02:00
2023-09-06 12:11:16 +02:00
nativeBuildInputs = [ yarn fixup_yarn_lock nodejs-slim ];
2019-10-05 09:46:51 +02:00
2023-09-06 12:11:16 +02:00
postPatch = ''
export HOME=$NIX_BUILD_TOP/fake_home
yarn config --offline set yarn-offline-mirror $offlineCache
fixup_yarn_lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules/
'';
2019-10-05 09:46:51 +02:00
buildPhase = ''
2023-09-06 12:11:16 +02:00
runHook preBuild
2023-09-06 12:11:16 +02:00
export NODE_OPTIONS=--openssl-legacy-provider
yarn --offline build
2023-09-06 12:11:16 +02:00
runHook postBuild
'';
2023-09-06 12:11:16 +02:00
installPhase = ''
runHook preInstall
2023-09-06 12:11:16 +02:00
mv build $out
2023-09-06 12:11:16 +02:00
runHook postInstall
2019-10-05 09:46:51 +02:00
'';
}