Conversation
https://github.com/henrygd/beszel/releases/tag/v0.12.4 https://github.com/henrygd/beszel/releases/tag/v0.12.5 https://github.com/henrygd/beszel/releases/tag/v0.12.6 https://github.com/henrygd/beszel/releases/tag/v0.12.7 https://github.com/henrygd/beszel/releases/tag/v0.12.8 https://github.com/henrygd/beszel/releases/tag/v0.12.9
| npmHash = "sha256-2zpJgkDXZoMWI6SkcfrhzozAITUR9ZUVtMbRtYKM13w="; | ||
| goHash = "sha256-8Sr7MYQnIfNx9hvfjCTYKQOUZIBxpGPbsR75jEB0mbk="; | ||
| in | ||
| buildGoModule rec { |
There was a problem hiding this comment.
rec should be slowly replaced with the finalAttrs syntax, which will make the let in block depricated.
I am also not sure if the update-script will work if the hashes are somewhere else in the nix file.
There was a problem hiding this comment.
Also regardin the nix-update-script, maybe an extraArgs argument should be passed down, so the webui also gets updated with the script (could be the cause for now auto-updates being triggered).
Something like this should work:
passthru.updateScript = nix-update-script {
extraArgs = [
"--subpackage"
"webui"
];
};If you want, you can put in this commit too, or I can make a separate PR after this gets merged (with 0.12.10 maybe?) since the folder structure changed...
There was a problem hiding this comment.
Honestly I'm really new to writing nix modules so I don't think I understand what whis does, or your comment about rec and finalAttrs :P
There was a problem hiding this comment.
This change would enable it to auto-update in the future and we don't have to fetch the correct hash values. Regarding the other comment, maybe look at this version of the nix file:
{
buildGoModule,
lib,
fetchFromGitHub,
nix-update-script,
buildNpmPackage,
}:
buildGoModule (finalAttrs: {
pname = "beszel";
version = "0.12.10";
src = fetchFromGitHub {
owner = "henrygd";
repo = "beszel";
tag = "v${finalAttrs.version}";
hash = "sha256-6hqRlttuDU5mAqgClc5I+lSx+XHpNPuOLirbVEA08/g=";
};
webui = buildNpmPackage {
inherit (finalAttrs)
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 = "${finalAttrs.src.name}/internal/site";
npmDepsHash = "sha256-8Y/Klpy2VIeg/o6n+EeYMvh0Y3GrNgIo7kRxYye3Rr4=";
};
# sourceRoot = "${src.name}";
vendorHash = "sha256-8Y/Klpy2VIeg/o6n+EeYMvh0Y3GrNgIo7kRxYye3Rr4=";
postPatch = ''substituteInPlace go.mod --replace "go 1.25.1" "go 1.25.0"'';
preBuild = ''
mkdir -p site/dist
cp -r ${finalAttrs.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 {
extraArgs = [
"--subpackage"
"webui"
];
};
meta = {
homepage = "https://github.com/henrygd/beszel";
changelog = "https://github.com/henrygd/beszel/releases/tag/v${finalAttrs.version}";
description = "Lightweight server monitoring hub with historical data, docker stats, and alerts";
maintainers = with lib.maintainers; [ bot-wxt1221 ];
license = lib.licenses.mit;
};
})| vendorHash = goHash; | ||
|
|
||
| # TODO remove when #441125 is merged into master | ||
| postPatch = ''substituteInPlace go.mod --replace "go 1.25.1" "go 1.25.0"''; |
There was a problem hiding this comment.
Thanks for the hint! I was able to make some final tweaks and make it build!
|
Here is what worked for me, including updating it {
buildGoModule,
lib,
fetchFromGitHub,
nix-update-script,
buildNpmPackage,
}:
buildGoModule (finalAttrs: {
pname = "beszel";
version = "0.13.1";
src = fetchFromGitHub {
owner = "henrygd";
repo = "beszel";
tag = "v${finalAttrs.version}";
hash = "sha256-b7VooNii3cmGZxRIQKs0QoflMA6XNknERNPETJyhPSQ=";
};
webui = buildNpmPackage {
inherit (finalAttrs)
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 = "${finalAttrs.src.name}/internal/site";
npmDepsHash = "sha256-a+G1SouUcc/iG7H1lC2t/CcTH4SrRmMujMZWLpLe7U0=";
};
vendorHash = "sha256-IfwgL4Ms5Uho1l0yGCyumbr1N/SN+j5HaFl4hACkTsQ=";
preBuild = ''
mkdir -p internal/site/dist
cp -r ${finalAttrs.webui}/* internal/site/dist
'';
postInstall = ''
mv $out/bin/agent $out/bin/beszel-agent
mv $out/bin/hub $out/bin/beszel-hub
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--subpackage"
"webui"
];
};
meta = {
homepage = "https://github.com/henrygd/beszel";
changelog = "https://github.com/henrygd/beszel/releases/tag/v${finalAttrs.version}";
description = "Lightweight server monitoring hub with historical data, docker stats, and alerts";
maintainers = with lib.maintainers; [ bot-wxt1221 ];
license = lib.licenses.mit;
};
})@non-bin FYI: this uses the |
|
outdated |
I added myself as a maintainer to the new module I made in #444936, but it's not merged, so I didn't add myself to this yet. I will in the next update after the module is merged.
I have a patch to reduce the required go version because
1.25.1isn't in master yet #441125Changes
https://github.com/henrygd/beszel/releases/tag/v0.12.4
https://github.com/henrygd/beszel/releases/tag/v0.12.5
https://github.com/henrygd/beszel/releases/tag/v0.12.6
https://github.com/henrygd/beszel/releases/tag/v0.12.7
https://github.com/henrygd/beszel/releases/tag/v0.12.8
https://github.com/henrygd/beszel/releases/tag/v0.12.9
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.