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;
port = 5006;
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
extraServices.listssrht-lmtp = {
wants = [ "postfix.service" ];

View file

@ -1,5 +1,6 @@
{ lib
, fetchFromSourcehut
, buildGoModule
, buildPythonPackage
, srht
, asyncpg
@ -8,23 +9,35 @@
, emailthreads
, redis
, python
, unzip
}:
buildPythonPackage rec {
pname = "listssrht";
version = "0.51.7";
version = "0.51.9";
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "lists.sr.ht";
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 = [
# Revert change breaking Unix socket support for Redis
patches/redis-socket/lists/0001-Revert-Add-webhook-queue-monitoring.patch
];
postPatch = ''
substituteInPlace Makefile \
--replace "all: api" ""
'';
nativeBuildInputs = srht.nativeBuildInputs;
@ -42,6 +55,10 @@ buildPythonPackage rec {
export SRHT_PATH=${srht}/${python.sitePackages}/srht
'';
postInstall = ''
ln -s ${listssrht-api}/bin/api $out/bin/listssrht-api
'';
pythonImportsCheck = [ "listssrht" ];
meta = with lib; {