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

76 lines
1.3 KiB
Nix
Raw Normal View History

2021-04-18 05:11:24 +02:00
{ lib
, fetchFromSourcehut
, buildPythonPackage
2020-06-23 02:18:52 +02:00
, buildGoModule
2021-04-18 05:11:24 +02:00
, pgpy
, srht
, redis
, bcrypt
, qrcode
, stripe
, zxcvbn
, alembic
, pystache
, dnspython
, sshpubkeys
, weasyprint
, prometheus_client
, python
}:
2020-06-23 02:18:52 +02:00
let
2021-04-18 05:11:24 +02:00
version = "0.53.14";
2021-04-18 05:11:24 +02:00
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "meta.sr.ht";
rev = version;
sha256 = "sha256-/+r/XLDkcSTW647xPMh5bcJmR2xZNNH74AJ5jemna2k=";
};
buildApi = src: buildGoModule {
2020-06-23 02:18:52 +02:00
inherit src version;
pname = "metasrht-api";
2021-04-18 05:11:24 +02:00
vendorSha256 = "sha256-eZyDrr2VcNMxI++18qUy7LA1Q1YDlWCoRtl00L8lfR4=";
2020-06-23 02:18:52 +02:00
};
2021-04-18 05:11:24 +02:00
in
buildPythonPackage rec {
pname = "metasrht";
inherit version src;
nativeBuildInputs = srht.nativeBuildInputs;
propagatedBuildInputs = [
pgpy
srht
redis
bcrypt
qrcode
stripe
zxcvbn
alembic
pystache
sshpubkeys
weasyprint
2021-04-18 05:11:24 +02:00
prometheus_client
dnspython
];
preBuild = ''
export PKGVER=${version}
2021-04-18 05:11:24 +02:00
export SRHT_PATH=${srht}/${python.sitePackages}/srht
'';
2020-06-23 02:18:52 +02:00
postInstall = ''
mkdir -p $out/bin
2021-04-18 05:11:24 +02:00
cp ${buildApi "${src}/api/"}/bin/api $out/bin/metasrht-api
2020-06-23 02:18:52 +02:00
'';
meta = with lib; {
homepage = "https://git.sr.ht/~sircmpwn/meta.sr.ht";
description = "Account management service for the sr.ht network";
license = licenses.agpl3;
maintainers = with maintainers; [ eadwu ];
};
}