sourcehut.metasrht: 0.57.5 -> 0.58.8

This commit is contained in:
Julien Moutinho 2022-05-06 00:07:02 +02:00 committed by tomberek
parent a3297babdc
commit bcb91bbeb7
2 changed files with 16 additions and 10 deletions

View file

@ -1252,6 +1252,10 @@ in
inherit configIniOfService;
port = 5000;
webhooks = true;
extraTimers.metasrht-daily.timerConfig = {
OnCalendar = ["daily"];
AccuracySec = "1h";
};
extraServices.metasrht-api = {
serviceConfig.Restart = "always";
serviceConfig.RestartSec = "2s";
@ -1268,10 +1272,6 @@ in
) cfg.settings));
serviceConfig.ExecStart = "${pkgs.sourcehut.metasrht}/bin/metasrht-api -b ${cfg.listenAddress}:${toString (cfg.meta.port + 100)}";
};
extraTimers.metasrht-daily.timerConfig = {
OnCalendar = ["daily"];
AccuracySec = "1h";
};
extraConfig = mkMerge [
{
assertions = [

View file

@ -16,22 +16,24 @@
, weasyprint
, prometheus-client
, python
, unzip
}:
let
version = "0.57.5";
version = "0.58.8";
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "meta.sr.ht";
rev = version;
sha256 = "sha256-qsCwZaCiqvY445U053OCWD98jlIUi9NB2jWVP2oW3Vk=";
sha256 = "sha256-lnEt5UoQBd5qlkD+nE6KL5DP4jf1FrAjgA06/mgRxTs=";
};
buildApi = src: buildGoModule {
metasrht-api = buildGoModule ({
inherit src version;
pname = "metasrht-api";
vendorSha256 = "sha256-8Ubrr9qRlgW2wsLHrPHwulSWLz+gp4VPcTvOZpg8TYM=";
};
modRoot = "api";
vendorSha256 = "sha256-3s9PYUy4qS06zyTIRDvnAmhfrjVLBa/03Nu3tMcIReI=";
} // import ./fix-gqlgen-trimpath.nix {inherit unzip;});
in
buildPythonPackage rec {
@ -42,6 +44,10 @@ buildPythonPackage rec {
# Revert change breaking Unix socket support for Redis
patches/redis-socket/meta/0001-Revert-Add-webhook-queue-monitoring.patch
];
postPatch = ''
substituteInPlace Makefile \
--replace "all: api" ""
'';
nativeBuildInputs = srht.nativeBuildInputs;
@ -68,7 +74,7 @@ buildPythonPackage rec {
postInstall = ''
mkdir -p $out/bin
cp ${buildApi "${src}/api/"}/bin/api $out/bin/metasrht-api
ln -s ${metasrht-api}/bin/api $out/bin/metasrht-api
'';
pythonImportsCheck = [ "metasrht" ];