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

78 lines
1.4 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
2021-12-14 05:48:43 +00:00
version = "0.57.1";
2021-04-18 03:11:24 +00:00
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "meta.sr.ht";
rev = version;
2021-12-14 05:48:43 +00:00
sha256 = "sha256-s1jTEZYp6SUnJMSxA7vg9HQ0iCuIc7Z39R7FllUqf8c=";
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";
2021-12-14 05:48:43 +00:00
vendorSha256 = "sha256-msad6OvKQnDwkl7azNIleCqwPVdLEDolDKJduhEw25g=";
2020-06-23 00:18:52 +00:00
};
2021-04-18 03:11:24 +00:00
in
buildPythonPackage rec {
pname = "metasrht";
inherit version src;
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 ];
};
}