77 lines
1.6 KiB
Nix
77 lines
1.6 KiB
Nix
{
|
|
buildGoModule,
|
|
lib,
|
|
fetchFromGitHub,
|
|
nix-update-script,
|
|
buildNpmPackage,
|
|
}:
|
|
buildGoModule rec {
|
|
pname = "beszel";
|
|
version = "0.12.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "henrygd";
|
|
repo = "beszel";
|
|
tag = "v${version}";
|
|
hash = "sha256-rthaufUL0JX3sE2hdrcJ8J73DLK4/2wMR+uOs8GoX2A=";
|
|
};
|
|
|
|
webui = buildNpmPackage {
|
|
inherit
|
|
pname
|
|
version
|
|
src
|
|
meta
|
|
;
|
|
|
|
npmFlags = [ "--legacy-peer-deps" ];
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
|
|
npx lingui extract --overwrite
|
|
npx lingui compile
|
|
node --max_old_space_size=1024000 ./node_modules/vite/bin/vite.js build
|
|
|
|
runHook postBuild
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out
|
|
cp -r dist/* $out
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
sourceRoot = "${src.name}/beszel/site";
|
|
|
|
npmDepsHash = "sha256-6J1LwRzwbQyXVBHNgG7k8CQ67JZIDqYreDbgfm6B4w4=";
|
|
};
|
|
|
|
sourceRoot = "${src.name}/beszel";
|
|
|
|
vendorHash = "sha256-Nd2jDlq+tdGrgxU6ZNgj9awAb+G/yDqY1J15dpMcjtw=";
|
|
|
|
preBuild = ''
|
|
mkdir -p site/dist
|
|
cp -r ${webui}/* site/dist
|
|
'';
|
|
|
|
postInstall = ''
|
|
mv $out/bin/agent $out/bin/beszel-agent
|
|
mv $out/bin/hub $out/bin/beszel-hub
|
|
'';
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
homepage = "https://github.com/henrygd/beszel";
|
|
changelog = "https://github.com/henrygd/beszel/releases/tag/v${version}";
|
|
description = "Lightweight server monitoring hub with historical data, docker stats, and alerts";
|
|
maintainers = with lib.maintainers; [ bot-wxt1221 ];
|
|
license = lib.licenses.mit;
|
|
};
|
|
}
|