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