Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 buildGoModule,
3 lib,
4 fetchFromGitHub,
5 nix-update-script,
6 buildNpmPackage,
7}:
8
9buildGoModule rec {
10 pname = "beszel";
11 version = "0.11.1";
12
13 src = fetchFromGitHub {
14 owner = "henrygd";
15 repo = "beszel";
16 tag = "v${version}";
17 hash = "sha256-tAi48PAHDGIZn/HMsnCq0mLpvFSqUOMocq47hooiFT8=";
18 };
19
20 webui = buildNpmPackage {
21 inherit
22 pname
23 version
24 src
25 meta
26 ;
27
28 npmFlags = [ "--legacy-peer-deps" ];
29
30 buildPhase = ''
31 runHook preBuild
32
33 npx lingui extract --overwrite
34 npx lingui compile
35 node --max_old_space_size=1024000 ./node_modules/vite/bin/vite.js build
36
37 runHook postBuild
38 '';
39
40 installPhase = ''
41 runHook preInstall
42
43 mkdir -p $out
44 cp -r dist/* $out
45
46 runHook postInstall
47 '';
48
49 sourceRoot = "${src.name}/beszel/site";
50
51 npmDepsHash = "sha256-27NUV23dNHFSwOHiB/wGSAWkp6eZMnw/6Pd3Fwn98+s=";
52 };
53
54 sourceRoot = "${src.name}/beszel";
55
56 vendorHash = "sha256-B6mOqOgcrRn0jV9wnDgRmBvfw7I/Qy5MNYvTiaCgjBE=";
57
58 preBuild = ''
59 mkdir -p site/dist
60 cp -r ${webui}/* site/dist
61 '';
62
63 postInstall = ''
64 mv $out/bin/agent $out/bin/beszel-agent
65 mv $out/bin/hub $out/bin/beszel-hub
66 '';
67
68 passthru.updateScript = nix-update-script { };
69
70 meta = {
71 homepage = "https://github.com/henrygd/beszel";
72 changelog = "https://github.com/henrygd/beszel/releases/tag/v${version}";
73 description = "Lightweight server monitoring hub with historical data, docker stats, and alerts";
74 maintainers = with lib.maintainers; [ bot-wxt1221 ];
75 license = lib.licenses.mit;
76 };
77}