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 13:11:16 +03:00
{ stdenv
, yarn
, fixup-yarn-lock
2023-09-06 13:11:16 +03:00
, nodejs-slim
, fetchFromGitHub
2023-09-06 05:42:25 +03:00
, fetchYarnDeps
2023-09-06 13:11:16 +03:00
, gotify-server
2019-10-05 10:46:51 +03:00
}:
2023-09-06 13:11:16 +03:00
stdenv.mkDerivation rec {
pname = "gotify-ui";
2023-09-06 13:11:16 +03:00
inherit (gotify-server) version;
2019-10-05 10:46:51 +03:00
2023-09-06 13:11:16 +03:00
src = gotify-server.src + "/ui";
2023-09-06 05:42:25 +03:00
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-ejHzo6NHCMlNiYePWvfMY9Blb58pj3UQ5PFI0V84flI=";
};
2019-10-05 10:46:51 +03:00
nativeBuildInputs = [ yarn fixup-yarn-lock nodejs-slim ];
2019-10-05 10:46:51 +03:00
2023-09-06 13:11:16 +03: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 13:11:16 +03:00
yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules/
'';
2019-10-05 10:46:51 +03:00
buildPhase = ''
2023-09-06 13:11:16 +03:00
runHook preBuild
2023-09-06 13:11:16 +03:00
export NODE_OPTIONS=--openssl-legacy-provider
yarn --offline build
2023-09-06 13:11:16 +03:00
runHook postBuild
'';
2023-09-06 13:11:16 +03:00
installPhase = ''
runHook preInstall
2023-09-06 13:11:16 +03:00
mv build $out
2023-09-06 13:11:16 +03:00
runHook postInstall
2019-10-05 10:46:51 +03:00
'';
}