2023-10-09 19:29:22 +00:00
|
|
|
{ stdenv
|
|
|
|
, yarn
|
2024-04-21 15:54:59 +00:00
|
|
|
, fixup-yarn-lock
|
2023-10-09 19:29:22 +00:00
|
|
|
, nodejs-slim
|
|
|
|
, fetchYarnDeps
|
|
|
|
, gotify-server
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-08-05 21:33:18 +00:00
|
|
|
pname = "gotify-ui";
|
2023-10-09 19:29:22 +00:00
|
|
|
inherit (gotify-server) version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
src = gotify-server.src + "/ui";
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = "${src}/yarn.lock";
|
|
|
|
hash = "sha256-ejHzo6NHCMlNiYePWvfMY9Blb58pj3UQ5PFI0V84flI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = [ yarn fixup-yarn-lock nodejs-slim ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
export HOME=$NIX_BUILD_TOP/fake_home
|
|
|
|
yarn config --offline set yarn-offline-mirror $offlineCache
|
2024-01-02 11:29:13 +00:00
|
|
|
fixup-yarn-lock yarn.lock
|
2023-10-09 19:29:22 +00:00
|
|
|
yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive
|
|
|
|
patchShebangs node_modules/
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
export NODE_OPTIONS=--openssl-legacy-provider
|
2023-10-09 19:29:22 +00:00
|
|
|
yarn --offline build
|
|
|
|
|
|
|
|
runHook postBuild
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mv build $out
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|