nixpkgs/pkgs/servers/gotify/ui.nix

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

47 lines
931 B
Nix
Raw Normal View History

2023-09-06 10:11:16 +00:00
{ stdenv
, yarn
, fixup-yarn-lock
2023-09-06 10:11:16 +00:00
, nodejs-slim
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 {
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
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
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
2023-09-06 10:11:16 +00:00
export NODE_OPTIONS=--openssl-legacy-provider
yarn --offline build
2023-09-06 10:11:16 +00:00
runHook postBuild
'';
2023-09-06 10:11:16 +00:00
installPhase = ''
runHook preInstall
2023-09-06 10:11:16 +00:00
mv build $out
2023-09-06 10:11:16 +00:00
runHook postInstall
2019-10-05 07:46:51 +00:00
'';
}