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-06-16 17:23:12 +00:00
|
|
|
version = "0.58.18";
|
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-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-OjbQHAzG2nZwpJUIvhKaCJWZbhZDC2R6C+SkbKUpk8o=";
|
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";
|
|
|
|
vendorSha256 = "sha256-kiEuEYZFbwJ6SbKFtxH4SiRaZmqYriRHPoHdTX28+d0=";
|
|
|
|
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; });
|
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
|
|
|
nativeBuildInputs = srht.nativeBuildInputs;
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|