Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
55 lines
1.4 KiB
Nix
55 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
buildNpmPackage,
|
|
fetchFromGitHub,
|
|
nix-update-script,
|
|
}:
|
|
|
|
buildNpmPackage rec {
|
|
pname = "nezha-theme-user";
|
|
version = "1.13.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "hamster1963";
|
|
repo = "nezha-dash-v1";
|
|
tag = "v${version}";
|
|
hash = "sha256-dg46wJtaY+b0gfL0+HchVNGFAx41Cz/moqL/8InNYp4=";
|
|
};
|
|
|
|
# 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${version}'
|
|
substituteInPlace src/components/Footer.tsx \
|
|
--replace-fail '/commit/' '/tree/'
|
|
'';
|
|
|
|
npmDepsHash = "sha256-n7ejpEkakvWO89GhHyy/QbxNvDaXXIDGERc8neeIyoU=";
|
|
|
|
npmPackFlags = [ "--ignore-scripts" ];
|
|
|
|
npmFlags = [ "--legacy-peer-deps" ];
|
|
|
|
dontNpmInstall = true;
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
cp -r dist $out
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru.updateScript = nix-update-script { extraArgs = [ "--generate-lockfile" ]; };
|
|
|
|
meta = {
|
|
description = "Nezha monitoring user frontend based on next.js";
|
|
changelog = "https://github.com/hamster1963/nezha-dash-v1/releases/tag/v${version}";
|
|
homepage = "https://github.com/hamster1963/nezha-dash-v1";
|
|
license = lib.licenses.apsl20;
|
|
maintainers = with lib.maintainers; [ moraxyc ];
|
|
};
|
|
}
|