2023-10-09 19:29:22 +00:00
|
|
|
{ stdenv
|
|
|
|
, yarn
|
|
|
|
, fixup_yarn_lock
|
|
|
|
, nodejs-slim
|
|
|
|
, fetchFromGitHub
|
|
|
|
, 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
|
|
|
|
|
|
|
nativeBuildInputs = [ yarn fixup_yarn_lock nodejs-slim ];
|
|
|
|
|
|
|
|
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/
|
|
|
|
'';
|
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
|
|
|
}
|