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
2022-05-05 22:07:02 +00:00
, unzip
2021-04-18 03:11:24 +00:00
}:
2020-06-23 00:18:52 +00:00
let
2022-11-05 08:30:11 +00:00
version = "0.61.3";
2021-04-18 03:11:24 +00:00
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "meta.sr.ht";
rev = version;
2022-11-05 08:30:11 +00:00
hash = "sha256-wMcpdRSRvxYEV163mdTGOemk62gljua89SOtwe6qGXU=";
2021-04-18 03:11:24 +00:00
};
2022-05-05 22:07:02 +00:00
metasrht-api = buildGoModule ({
2020-06-23 00:18:52 +00:00
inherit src version;
pname = "metasrht-api";
2022-05-05 22:07:02 +00:00
modRoot = "api";
2022-11-05 08:30:11 +00:00
vendorHash = "sha256-ZoDRGmGe9o5pn89gJ60wjSp5Cc0yxRfvdhNnbwAhmSI=";
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.20"; });
2020-06-23 00:18:52 +00:00
2021-04-18 03:11:24 +00:00
in
buildPythonPackage rec {
pname = "metasrht";
inherit version src;
2022-05-05 22:07:02 +00:00
postPatch = ''
substituteInPlace Makefile \
--replace "all: api" ""
'';
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
2022-05-05 22:07:02 +00:00
ln -s ${metasrht-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 ];
};
}