2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromSourcehut
|
|
|
|
, buildPythonPackage
|
2020-09-25 04:45:31 +00:00
|
|
|
, buildGoModule
|
2021-05-20 23:08:51 +00:00
|
|
|
, pgpy
|
|
|
|
, srht
|
|
|
|
, redis
|
|
|
|
, bcrypt
|
|
|
|
, qrcode
|
|
|
|
, stripe
|
|
|
|
, zxcvbn
|
|
|
|
, alembic
|
|
|
|
, pystache
|
|
|
|
, dnspython
|
|
|
|
, sshpubkeys
|
|
|
|
, weasyprint
|
2021-08-27 14:25:00 +00:00
|
|
|
, prometheus-client
|
2021-05-20 23:08:51 +00:00
|
|
|
, python
|
2022-06-16 17:23:12 +00:00
|
|
|
, unzip
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-09-25 04:45:31 +00:00
|
|
|
let
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "0.61.3";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "meta.sr.ht";
|
|
|
|
rev = version;
|
2022-11-21 17:40:18 +00:00
|
|
|
hash = "sha256-wMcpdRSRvxYEV163mdTGOemk62gljua89SOtwe6qGXU=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
metasrht-api = buildGoModule ({
|
2020-09-25 04:45:31 +00:00
|
|
|
inherit src version;
|
|
|
|
pname = "metasrht-api";
|
2022-06-16 17:23:12 +00:00
|
|
|
modRoot = "api";
|
2022-11-21 17:40:18 +00:00
|
|
|
vendorHash = "sha256-ZoDRGmGe9o5pn89gJ60wjSp5Cc0yxRfvdhNnbwAhmSI=";
|
|
|
|
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.20"; });
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "metasrht";
|
|
|
|
inherit version src;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "all: api" ""
|
|
|
|
'';
|
2021-12-30 13:39:12 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
pgpy
|
|
|
|
srht
|
|
|
|
redis
|
|
|
|
bcrypt
|
|
|
|
qrcode
|
|
|
|
stripe
|
|
|
|
zxcvbn
|
|
|
|
alembic
|
|
|
|
pystache
|
|
|
|
sshpubkeys
|
|
|
|
weasyprint
|
2021-08-27 14:25:00 +00:00
|
|
|
prometheus-client
|
2021-05-20 23:08:51 +00:00
|
|
|
dnspython
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export PKGVER=${version}
|
2021-05-20 23:08:51 +00:00
|
|
|
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
2020-09-25 04:45:31 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin
|
2022-06-16 17:23:12 +00:00
|
|
|
ln -s ${metasrht-api}/bin/api $out/bin/metasrht-api
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
pythonImportsCheck = [ "metasrht" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://git.sr.ht/~sircmpwn/meta.sr.ht";
|
|
|
|
description = "Account management service for the sr.ht network";
|
2021-12-30 13:39:12 +00:00
|
|
|
license = licenses.agpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ eadwu ];
|
|
|
|
};
|
|
|
|
}
|