nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildNpmPackage,
4 fetchFromGitHub,
5 nix-update-script,
6}:
7
8buildNpmPackage rec {
9 pname = "nezha-theme-admin";
10 version = "1.13.0";
11
12 src = fetchFromGitHub {
13 owner = "nezhahq";
14 repo = "admin-frontend";
15 tag = "v${version}";
16 hash = "sha256-9/lrbVfC+CRQCSJNx7dwKWPgemM6hbd6ZR5xG3tj8wA=";
17 };
18
19 # TODO: Switch to the bun build function once available in nixpkgs
20 postPatch = ''
21 cp ${./package-lock.json} package-lock.json
22 '';
23
24 npmDepsHash = "sha256-2iX3/Pw6i2zXH+cpMC6ttn5D/C8G/P9WgRApO7Br5p4=";
25
26 npmPackFlags = [ "--ignore-scripts" ];
27
28 npmBuildScript = "build-ignore-error";
29
30 dontNpmInstall = true;
31 installPhase = ''
32 runHook preInstall
33
34 cp -r dist $out
35
36 runHook postInstall
37 '';
38
39 passthru.updateScript = nix-update-script { extraArgs = [ "--generate-lockfile" ]; };
40
41 meta = {
42 description = "Nezha monitoring admin frontend";
43 homepage = "https://github.com/nezhahq/admin-frontend";
44 changelog = "https://github.com/nezhahq/admin-frontend/releases/tag/v${version}";
45 license = lib.licenses.asl20;
46 maintainers = with lib.maintainers; [ moraxyc ];
47 };
48}