diff --git a/pkgs/by-name/be/beszel/package.nix b/pkgs/by-name/be/beszel/package.nix new file mode 100644 index 00000000000000..000c60e60046d5 --- /dev/null +++ b/pkgs/by-name/be/beszel/package.nix @@ -0,0 +1,72 @@ +{ + buildGoModule, + lib, + fetchFromGitHub, + nix-update-script, + buildNpmPackage, + npm-lockfile-fix, +}: + +buildGoModule rec { + pname = "beszel"; + version = "0.6.2"; + + src = fetchFromGitHub { + owner = "henrygd"; + repo = "beszel"; + rev = "refs/tags/v${version}"; + hash = "sha256-x9HU+sDjxRthC4ROJaKbuKHPHgxFSpyn/dywyGWE/v8="; + }; + + webui = buildNpmPackage { + inherit + pname + version + src + meta + ; + + npmFlags = [ "--legacy-peer-deps" ]; + + buildPhase = '' + runHook preBuild + + 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-m6C1aHsojS/5VYTW7J0bPi1VL7QtKILVZnAgd3zNqxE="; + }; + + sourceRoot = "${src.name}/beszel"; + + vendorHash = "sha256-/FePQkqoeuH63mV81v1NxpFw9osMUCcZ1bP+0yN1Qlo="; + + preBuild = '' + mkdir -p site/dist + cp -r ${webui}/* site/dist + ''; + + 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; + mainProgram = "hub"; + }; +}