nezha-theme-user: 2.0.1 -> 2.2.1; switch to pnpm (#532196)

This commit is contained in:
Weijia Wang
2026-06-17 12:34:41 +00:00
committed by GitHub
2 changed files with 23 additions and 5193 deletions
File diff suppressed because it is too large Load Diff
+23 -15
View File
@@ -2,36 +2,44 @@
lib,
buildNpmPackage,
fetchFromGitHub,
fetchPnpmDeps,
pnpmConfigHook,
pnpm_11,
nix-update-script,
}:
let
pnpm = pnpm_11;
in
buildNpmPackage (finalAttrs: {
pname = "nezha-theme-user";
version = "2.0.1";
version = "2.2.1";
src = fetchFromGitHub {
owner = "hamster1963";
repo = "nezha-dash-v1";
repo = "nezha-dash-v2";
tag = "v${finalAttrs.version}";
hash = "sha256-3zaA3T4zW18caOQe5DBF8Zsms3cjks3Ywyfkyk6N2N0=";
hash = "sha256-X7NRpDeZqLijgbUQOEdML00TPRM2D55zlJkzWB2TKfM=";
};
# TODO: Switch to the bun build function once available in nixpkgs
postPatch = ''
cp ${./package-lock.json} package-lock.json
# We cannot directly get the git commit hash from the tarball
substituteInPlace vite.config.ts \
--replace-fail 'git rev-parse --short HEAD' 'echo refs/tags/v${finalAttrs.version}'
--replace-fail 'git rev-parse --short HEAD' 'echo ${finalAttrs.src.rev}'
substituteInPlace src/components/Footer.tsx \
--replace-fail '/commit/' '/tree/'
'';
npmDepsHash = "sha256-hjVvp2dWBHqXrq/7+kLDmcUUrV15ln/8tNNqDmJ/Sh4=";
nativeBuildInputs = [ pnpm ];
npmPackFlags = [ "--ignore-scripts" ];
npmFlags = [ "--legacy-peer-deps" ];
npmDeps = null;
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) pname version src;
inherit pnpm;
fetcherVersion = 4;
hash = "sha256-4Zfiw//9w16I2CXOEy/ocAI5frK5w4g3b8pxguGWOdA=";
};
npmConfigHook = pnpmConfigHook;
dontNpmInstall = true;
installPhase = ''
@@ -42,13 +50,13 @@ buildNpmPackage (finalAttrs: {
runHook postInstall
'';
passthru.updateScript = nix-update-script { extraArgs = [ "--generate-lockfile" ]; };
passthru.updateScript = nix-update-script { };
meta = {
description = "Nezha monitoring user frontend based on next.js";
changelog = "https://github.com/hamster1963/nezha-dash-v1/releases/tag/v${finalAttrs.version}";
homepage = "https://github.com/hamster1963/nezha-dash-v1";
license = lib.licenses.apsl20;
changelog = "https://github.com/hamster1963/nezha-dash-v2/releases/tag/v${finalAttrs.version}";
homepage = "https://github.com/hamster1963/nezha-dash-v2";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ moraxyc ];
};
})