tracks lexicons and how many times they appeared on the jetstream
1{
2 lib,
3 stdenv,
4 makeBinaryWrapper,
5 bun,
6 client-modules,
7 PUBLIC_API_URL ? "http://localhost:3713",
8}:
9stdenv.mkDerivation {
10 pname = "client";
11 version = "main";
12
13 src = ../client;
14
15 inherit PUBLIC_API_URL;
16
17 nativeBuildInputs = [makeBinaryWrapper];
18 buildInputs = [bun];
19
20 dontCheck = true;
21
22 configurePhase = ''
23 runHook preConfigure
24 cp -R --no-preserve=ownership ${client-modules} node_modules
25 find node_modules -type d -exec chmod 755 {} \;
26 substituteInPlace node_modules/.bin/vite \
27 --replace-fail "/usr/bin/env node" "${bun}/bin/bun --bun"
28 runHook postConfigure
29 '';
30 buildPhase = ''
31 runHook preBuild
32 bun --prefer-offline run build
33 runHook postBuild
34 '';
35 installPhase = ''
36 runHook preInstall
37
38 mkdir -p $out/bin
39 cp -R ./build/* $out
40 cp -R ./node_modules $out
41
42 makeBinaryWrapper ${bun}/bin/bun $out/bin/website \
43 --prefix PATH : ${lib.makeBinPath [ bun ]} \
44 --add-flags "run --bun --no-install --cwd $out start"
45
46 runHook postInstall
47 '';
48}