{ lib, fetchFromGitHub, makeBinaryWrapper, nodejs, pnpm, replaceVars, stdenv, }: stdenv.mkDerivation (finalAttrs: { pname = "rsshub"; version = "0-unstable-2024-09-16"; src = fetchFromGitHub { owner = "DIYgod"; repo = "RSSHub"; rev = "6de50fb35dbdb93be43f315a8c2651e90c5195a9"; hash = "sha256-fxkK1prrKfAmB5yqiOKdLPeJp/hO07KJNHLnYSQGPNE="; }; patches = [ (replaceVars ./0001-fix-git-hash.patch { "GIT_HASH" = finalAttrs.src.rev; }) ]; pnpmDeps = pnpm.fetchDeps { inherit (finalAttrs) pname version src; hash = "sha256-mAAo4SdJ8cj8aqnbm+azcnxq8lFBvOy3BlSEKz9MA0Q="; }; nativeBuildInputs = [ makeBinaryWrapper nodejs pnpm.configHook ]; buildPhase = '' runHook preBuild pnpm build runHook postBuild ''; installPhase = '' runHook preInstall mkdir -p $out/bin $out/lib/rsshub cp -r lib node_modules assets api package.json tsconfig.json $out/lib/rsshub runHook postInstall ''; preFixup = '' makeWrapper ${lib.getExe nodejs} $out/bin/rsshub \ --chdir "$out/lib/rsshub" \ --set "NODE_ENV" "production" \ --set "NO_LOGFILES" "true" \ --set "TSX_TSCONFIG_PATH" "$out/lib/rsshub/tsconfig.json" \ --append-flags "$out/lib/rsshub/node_modules/tsx/dist/cli.mjs" \ --append-flags "$out/lib/rsshub/lib/index.ts" ''; meta = { description = "RSS feed generator"; longDescription = '' RSSHub is an open source, easy to use, and extensible RSS feed generator. It's capable of generating RSS feeds from pretty much everything. RSSHub delivers millions of contents aggregated from all kinds of sources, our vibrant open source community is ensuring the deliver of RSSHub's new routes, new features and bug fixes. ''; homepage = "https://docs.rsshub.app"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ Guanran928 ]; mainProgram = "rsshub"; platforms = lib.platforms.all; }; })