nezha-theme-admin: 2.0.4 -> 2.2.4

This commit is contained in:
Moraxyc
2026-06-23 23:51:19 +08:00
parent 5bba54b360
commit 704b3a3d2e
3 changed files with 2759 additions and 3159 deletions
File diff suppressed because it is too large Load Diff
@@ -2,26 +2,25 @@
lib,
buildNpmPackage,
fetchFromGitHub,
nix-update-script,
}:
buildNpmPackage (finalAttrs: {
pname = "nezha-theme-admin";
version = "2.0.4";
version = "2.2.4";
src = fetchFromGitHub {
owner = "nezhahq";
repo = "admin-frontend";
tag = "v${finalAttrs.version}";
hash = "sha256-oZFIkeHkuSLlu++FwzCUet7tmBe5zhCP5MGHhU528DA=";
hash = "sha256-1MS+ZOTeK3tZMCDvh0MEkF4K04cOlA+uAsYwXmasdhY=";
};
# TODO: Switch to the bun build function once available in nixpkgs
# TODO: Remove after upstream fixes resolved missing.
postPatch = ''
cp ${./package-lock.json} package-lock.json
'';
npmDepsHash = "sha256-2DkCVefxSfnlJkaEFZrjsWbwzddtqiNg1UUajRG5tLA=";
npmDepsHash = "sha256-j7z4Zc2SnewnX3fXu8vqxSLx1S8Vz9+SivwpHuzNrIc=";
npmPackFlags = [ "--ignore-scripts" ];
npmBuildScript = "build-ignore-error";
@@ -34,7 +33,7 @@ buildNpmPackage (finalAttrs: {
runHook postInstall
'';
passthru.updateScript = nix-update-script { extraArgs = [ "--generate-lockfile" ]; };
passthru.updateScript = ./update.sh;
meta = {
description = "Nezha monitoring admin frontend";
+25
View File
@@ -0,0 +1,25 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p nix-update curl nodejs
set -euo pipefail
version=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/nezhahq/admin-frontend/releases/latest | jq -r ".tag_name")
version=${version#v}
if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
echo "Already up to date!"
exit 0
fi
TMPDIR=$(mktemp -d)
trap 'rm -rf -- "${TMPDIR}"' EXIT
git clone "https://github.com/nezhahq/admin-frontend" -b "v$version" "$TMPDIR/src"
pushd "$TMPDIR/src"
rm package-lock.json
npm install --package-lock-only --ignore-scripts
popd
cp "$TMPDIR/src/package-lock.json" pkgs/by-name/ne/nezha-theme-admin/
nix-update "$UPDATE_NIX_ATTR_PATH"