Skip to content

Commit

Permalink
beszel: init at 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bot-wxt1221 committed Oct 3, 2024
1 parent 77a6708 commit a94f59b
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 0 deletions.
49 changes: 49 additions & 0 deletions beszel.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
warning: found empty hash, assuming 'sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA='
warning: error: unable to download 'https://nix-community.cachix.org/aqii60g5nvfgqil4j9qvgfw2k79cl9jq.narinfo': Error in the HTTP2 framing layer (16); retrying in 334 ms
warning: error: unable to download 'https://nix-community.cachix.org/rliymqcw22ysnbnrqh3c8zndmiqjk5ql.narinfo': SSL connect error (35); retrying in 266 ms
these 3 derivations will be built:
/nix/store/jqfvp80v0rbl0cpa7wl4nhwdjf6brna8-beszel-0.5.1-npm-deps.drv
/nix/store/k6n453qq2l8ch7blr5qv1vh6w4ybrgxy-beszel-0.5.1.drv
/nix/store/h5wq29wmxxv5qpcpmsr992gfdgxcp2z8-beszel-0.5.1-go-modules.drv
this path will be fetched (40.47 MiB download, 212.77 MiB unpacked):
/nix/store/chzgk756zb2cqlzbjr86m0lfxi63cdfy-go-1.22.7
copying path '/nix/store/chzgk756zb2cqlzbjr86m0lfxi63cdfy-go-1.22.7' from 'https://mirrors.ustc.edu.cn/nix-channels/store'...
building '/nix/store/jqfvp80v0rbl0cpa7wl4nhwdjf6brna8-beszel-0.5.1-npm-deps.drv'...
Running phase: unpackPhase
unpacking source archive /nix/store/a1nza0a3q3r0b22bzg9fbxp3sin44b4r-source
source root is source/beszel/site
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
no configure script, doing nothing
Running phase: buildPhase
Error: No cacheable dependencies were found. Please inspect the upstream `package-lock.json` file and ensure that remote dependencies have `resolved` URLs and `integrity` hashes. If the lockfile is missing this data, attempt to get upstream to fix it via a tool like <https://github.com/jeslie0/npm-lockfile-fix>. If generating an empty cache is intentional and you would like to do it anyways, set `forceEmptyCache = true`.
error: builder for '/nix/store/jqfvp80v0rbl0cpa7wl4nhwdjf6brna8-beszel-0.5.1-npm-deps.drv' failed with exit code 1;
last 9 log lines:
> Running phase: unpackPhase
> unpacking source archive /nix/store/a1nza0a3q3r0b22bzg9fbxp3sin44b4r-source
> source root is source/beszel/site
> Running phase: patchPhase
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> no configure script, doing nothing
> Running phase: buildPhase
> Error: No cacheable dependencies were found. Please inspect the upstream `package-lock.json` file and ensure that remote dependencies have `resolved` URLs and `integrity` hashes. If the lockfile is missing this data, attempt to get upstream to fix it via a tool like <https://github.com/jeslie0/npm-lockfile-fix>. If generating an empty cache is intentional and you would like to do it anyways, set `forceEmptyCache = true`.
For full logs, run 'nix log /nix/store/jqfvp80v0rbl0cpa7wl4nhwdjf6brna8-beszel-0.5.1-npm-deps.drv'.
error: 1 dependencies of derivation '/nix/store/k6n453qq2l8ch7blr5qv1vh6w4ybrgxy-beszel-0.5.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/h5wq29wmxxv5qpcpmsr992gfdgxcp2z8-beszel-0.5.1-go-modules.drv' failed to build
Traceback (most recent call last):
File "/nix/store/sy4nw98mprmxcf8xpqzqm227ghhvaakq-nix-update-1.5.2/bin/.nix-update-wrapped", line 9, in <module>
sys.exit(main())
^^^^^^
File "/nix/store/sy4nw98mprmxcf8xpqzqm227ghhvaakq-nix-update-1.5.2/lib/python3.12/site-packages/nix_update/__init__.py", line 311, in main
package = update(options)
^^^^^^^^^^^^^^^
File "/nix/store/sy4nw98mprmxcf8xpqzqm227ghhvaakq-nix-update-1.5.2/lib/python3.12/site-packages/nix_update/update.py", line 459, in update
update_go_modules_hash(opts, package.filename, package.go_modules)
File "/nix/store/sy4nw98mprmxcf8xpqzqm227ghhvaakq-nix-update-1.5.2/lib/python3.12/site-packages/nix_update/update.py", line 151, in update_go_modules_hash
target_hash = nix_prefetch(opts, "goModules")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/sy4nw98mprmxcf8xpqzqm227ghhvaakq-nix-update-1.5.2/lib/python3.12/site-packages/nix_update/update.py", line 128, in nix_prefetch
raise UpdateError(
nix_update.errors.UpdateError: failed to retrieve hash when trying to update beszel.goModules
74 changes: 74 additions & 0 deletions pkgs/by-name/be/beszel/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
buildGoModule,
lib,
fetchFromGitHub,
nix-update-script,
buildNpmPackage,
npm-lockfile-fix,
}:

buildGoModule rec {
pname = "beszel";
version = "0.5.1";

src = fetchFromGitHub {
owner = "henrygd";
repo = "beszel";
rev = "refs/tags/v${version}";
hash = "sha256-zToX6M6JqLnQ5YhHPjb30sijLVEs/H23zjrn6xLDDLM=";
postFetch = ''
${lib.getExe npm-lockfile-fix} $out/beszel/site/package-lock.json
'';
};

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-CtcFjPgWz21SmeneQbl2XypGejeKcFseS76ds2eCWuk=";
};

sourceRoot = "${src.name}/beszel";

vendorHash = "sha256-1K3qxhu2ng1purHce83270hOJwm5WB114nVeldkhTlc=";

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;
};
}

0 comments on commit a94f59b

Please sign in to comment.