nixpkgs/pkgs/applications/version-management/sourcehut/meta.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
1.5 KiB
Nix
Raw Normal View History

2021-04-18 03:11:24 +00:00
{ lib
, fetchFromSourcehut
, buildPythonPackage
2020-06-23 00:18:52 +00:00
, buildGoModule
2021-04-18 03:11:24 +00:00
, pgpy
, srht
, redis
, bcrypt
, qrcode
, stripe
, zxcvbn
, alembic
, pystache
, dnspython
, sshpubkeys
, weasyprint
, prometheus-client
2021-04-18 03:11:24 +00:00
, python
}:
2020-06-23 00:18:52 +00:00
let
2022-02-12 00:45:12 +00:00
version = "0.57.5";
2021-04-18 03:11:24 +00:00
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "meta.sr.ht";
rev = version;
2022-02-12 00:45:12 +00:00
sha256 = "sha256-qsCwZaCiqvY445U053OCWD98jlIUi9NB2jWVP2oW3Vk=";
2021-04-18 03:11:24 +00:00
};
buildApi = src: buildGoModule {
2020-06-23 00:18:52 +00:00
inherit src version;
pname = "metasrht-api";
2022-02-12 00:45:12 +00:00
vendorSha256 = "sha256-8Ubrr9qRlgW2wsLHrPHwulSWLz+gp4VPcTvOZpg8TYM=";
2020-06-23 00:18:52 +00:00
};
2021-04-18 03:11:24 +00:00
in
buildPythonPackage rec {
pname = "metasrht";
inherit version src;
patches = [
# Revert change breaking Unix socket support for Redis
patches/redis-socket/meta/0001-Revert-Add-webhook-queue-monitoring.patch
];
nativeBuildInputs = srht.nativeBuildInputs;
propagatedBuildInputs = [
pgpy
srht
redis
bcrypt
qrcode
stripe
zxcvbn
alembic
pystache
sshpubkeys
weasyprint
prometheus-client
2021-04-18 03:11:24 +00:00
dnspython
];
preBuild = ''
export PKGVER=${version}
2021-04-18 03:11:24 +00:00
export SRHT_PATH=${srht}/${python.sitePackages}/srht
'';
2020-06-23 00:18:52 +00:00
postInstall = ''
mkdir -p $out/bin
2021-04-18 03:11:24 +00:00
cp ${buildApi "${src}/api/"}/bin/api $out/bin/metasrht-api
2020-06-23 00:18:52 +00:00
'';
2021-08-15 21:11:47 +00:00
pythonImportsCheck = [ "metasrht" ];
meta = with lib; {
homepage = "https://git.sr.ht/~sircmpwn/meta.sr.ht";
description = "Account management service for the sr.ht network";
2021-08-15 20:54:11 +00:00
license = licenses.agpl3Only;
maintainers = with maintainers; [ eadwu ];
};
}