sourcehut.listssrht: 0.51.7 -> 0.51.9

This commit is contained in:
Julien Moutinho 2022-05-06 00:05:06 +02:00 committed by tomberek
parent 0f1e37bc5b
commit 59d8439966
2 changed files with 24 additions and 2 deletions

View File

@ -1199,6 +1199,11 @@ in
inherit configIniOfService; inherit configIniOfService;
port = 5006; port = 5006;
webhooks = true; webhooks = true;
extraServices.listssrht-api = {
serviceConfig.Restart = "always";
serviceConfig.RestartSec = "2s";
serviceConfig.ExecStart = "${pkgs.sourcehut.listssrht}/bin/listssrht-api -b ${cfg.listenAddress}:${toString (cfg.lists.port + 100)}";
};
# Receive the mail from Postfix and enqueue them into Redis and PostgreSQL # Receive the mail from Postfix and enqueue them into Redis and PostgreSQL
extraServices.listssrht-lmtp = { extraServices.listssrht-lmtp = {
wants = [ "postfix.service" ]; wants = [ "postfix.service" ];

View File

@ -1,5 +1,6 @@
{ lib { lib
, fetchFromSourcehut , fetchFromSourcehut
, buildGoModule
, buildPythonPackage , buildPythonPackage
, srht , srht
, asyncpg , asyncpg
@ -8,23 +9,35 @@
, emailthreads , emailthreads
, redis , redis
, python , python
, unzip
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "listssrht"; pname = "listssrht";
version = "0.51.7"; version = "0.51.9";
src = fetchFromSourcehut { src = fetchFromSourcehut {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "lists.sr.ht"; repo = "lists.sr.ht";
rev = version; rev = version;
sha256 = "sha256-oNY5A98oVoL2JKO0fU/8YVl8u7ywmHb/RHD8A6z9yIM="; sha256 = "sha256-6iyt0XXAHvyp4bA+VW9uA9YP9wq2Rf/WYVZxylSRf7k=";
}; };
listssrht-api = buildGoModule ({
inherit src version;
pname = "listssrht-api";
modRoot = "api";
vendorSha256 = "sha256-xnmMkRSokbhWD+kz0XQ9AinYdm6/50FRBISURPvlzD0=";
} // import ./fix-gqlgen-trimpath.nix {inherit unzip;});
patches = [ patches = [
# Revert change breaking Unix socket support for Redis # Revert change breaking Unix socket support for Redis
patches/redis-socket/lists/0001-Revert-Add-webhook-queue-monitoring.patch patches/redis-socket/lists/0001-Revert-Add-webhook-queue-monitoring.patch
]; ];
postPatch = ''
substituteInPlace Makefile \
--replace "all: api" ""
'';
nativeBuildInputs = srht.nativeBuildInputs; nativeBuildInputs = srht.nativeBuildInputs;
@ -42,6 +55,10 @@ buildPythonPackage rec {
export SRHT_PATH=${srht}/${python.sitePackages}/srht export SRHT_PATH=${srht}/${python.sitePackages}/srht
''; '';
postInstall = ''
ln -s ${listssrht-api}/bin/api $out/bin/listssrht-api
'';
pythonImportsCheck = [ "listssrht" ]; pythonImportsCheck = [ "listssrht" ];
meta = with lib; { meta = with lib; {