From 74997a6fae32edf3347cd049caf5f646d495b6b9 Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Fri, 13 Dec 2024 14:28:50 +0800 Subject: [PATCH] nezha-theme-nazhua: init at 0.4.19 --- .../by-name/ne/nezha-theme-nazhua/package.nix | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 pkgs/by-name/ne/nezha-theme-nazhua/package.nix diff --git a/pkgs/by-name/ne/nezha-theme-nazhua/package.nix b/pkgs/by-name/ne/nezha-theme-nazhua/package.nix new file mode 100644 index 0000000000000..08fd8d00fbd50 --- /dev/null +++ b/pkgs/by-name/ne/nezha-theme-nazhua/package.nix @@ -0,0 +1,62 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, + yarnConfigHook, + yarnBuildHook, + yarnInstallHook, + fetchYarnDeps, + nodejs, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "nezha-theme-nazhua"; + version = "0.4.19"; + + src = fetchFromGitHub { + owner = "hi2shark"; + repo = "nazhua"; + tag = "v${finalAttrs.version}"; + hash = "sha256-0104g2HldjMDvd4F9krhx7h6qLiYmzQ2cRprvFJcZeU="; + }; + + yarnOfflineCache = fetchYarnDeps { + yarnLock = finalAttrs.src + "/yarn.lock"; + hash = "sha256-Wy4xtLjDNkBLeESJCbfq9GhT0mSTAfGBN0A3oHX5BuE="; + }; + + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + yarnInstallHook + # Needed for executing package.json scripts + nodejs + ]; + + # Copied from .github/workflows/release.yml + env = { + VITE_NEZHA_VERSION = "v1"; + VITE_SARASA_TERM_SC_USE_CDN = "1"; + VITE_USE_CDN = "1"; + VITE_CDN_LIB_TYPE = "jsdelivr"; + }; + + dontNpmInstall = true; + installPhase = '' + runHook preInstall + + cp -r dist $out + + runHook postInstall + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Nezha monitoring theme called Nazhua"; + changelog = "https://github.com/hi2shark/nazhua/releases/tag/v${finalAttrs.version}"; + homepage = "https://github.com/hi2shark/nazhua"; + license = lib.licenses.apsl20; + maintainers = with lib.maintainers; [ moraxyc ]; + }; +})