暂存打包结果

This commit is contained in:
2023-08-23 07:22:53 +08:00
parent ff056eee8b
commit ebd222abe7

View File

@@ -1,13 +1,36 @@
{ lib, mkPnpmPackage, fetchFromGitHub }:
mkPnpmPackage
{
{ lib, stdenv, mkPnpmPackage, fetchFromGitHub, nodejs }:
let
pname = "rsshub";
version = "20230823";
src = fetchFromGitHub
{
owner = "DIYgod";
repo = "RSSHub";
rev = "ecab0c0882a17b9b70431aca0c155a2da9d2c4fa";
hash = "sha256-VAIUQCQcKYaav4Ch73Cn7poO0/VCGtWkWJkPJ3Qp31A=";
rev = "0352743997ad8c7c137ad9adc767e2c70d143c54";
hash = "sha256-oqcEZs6XLyz/iUZLhzaj/aO1re/V+hy8ij45Y6L1uKA=";
};
nodeModulesPreBuild = "export PUPPETEER_SKIP_DOWNLOAD=true";
script = "build:all";
originalPnpmPackage = mkPnpmPackage { inherit pname version src nodejs; };
in stdenv.mkDerivation
{
inherit pname version src;
nodeModules = originalPnpmPackage.nodeModules.overrideAttrs { PUPPETEER_SKIP_DOWNLOAD = true; };
configurePhase =
''
export HOME=$NIX_BUILD_TOP # Some packages need a writable HOME
export npm_config_nodedir=${nodejs}
runHook preConfigure
${if installInPlace
then passthru.nodeModules.buildPhase
else ''
${if !copyNodeModules
then "ln -s"
else "cp -r"
} ${passthru.nodeModules}/. node_modules
''
}
runHook postConfigure
'';
}