2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromSourcehut
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildGoModule
|
2022-06-16 17:23:12 +00:00
|
|
|
, buildPythonPackage
|
2021-05-20 23:08:51 +00:00
|
|
|
, srht
|
|
|
|
, redis
|
|
|
|
, celery
|
|
|
|
, pyyaml
|
|
|
|
, markdown
|
|
|
|
, ansi2html
|
|
|
|
, python
|
2022-06-16 17:23:12 +00:00
|
|
|
, unzip
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2022-11-02 22:02:43 +00:00
|
|
|
version = "0.83.0";
|
2021-12-30 13:39:12 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "builds.sr.ht";
|
|
|
|
rev = version;
|
2022-11-02 22:02:43 +00:00
|
|
|
hash = "sha256-u/y+sYu/09LypWI/ngghbge5SvkuLQpray10j0SjlOo=";
|
2021-12-30 13:39:12 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
buildsrht-api = buildGoModule ({
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit src version;
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "buildsrht-api";
|
|
|
|
modRoot = "api";
|
2022-11-02 22:02:43 +00:00
|
|
|
vendorHash = "sha256-DfVWr/4J4ZrhHpy9CXPaAQcbag/9FmDgiexcNo0lEsk=";
|
|
|
|
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion= "0.17.20"; });
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
buildsrht-worker = buildGoModule {
|
|
|
|
inherit src version;
|
|
|
|
sourceRoot = "source/worker";
|
|
|
|
pname = "buildsrht-worker";
|
2022-09-30 11:47:45 +00:00
|
|
|
vendorHash = "sha256-y5RFPbtaGmgPpiV2Q3njeWORGZF1TJRjAbY6VgC1hek=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-05-20 23:08:51 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
2021-12-30 13:39:12 +00:00
|
|
|
inherit src version;
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "buildsrht";
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "all: api worker" ""
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
srht
|
|
|
|
redis
|
|
|
|
celery
|
|
|
|
pyyaml
|
|
|
|
markdown
|
2021-05-20 23:08:51 +00:00
|
|
|
ansi2html
|
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-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/lib
|
|
|
|
mkdir -p $out/bin/builds.sr.ht
|
|
|
|
|
|
|
|
cp -r images $out/lib
|
|
|
|
cp contrib/submit_image_build $out/bin/builds.sr.ht
|
2022-06-16 17:23:12 +00:00
|
|
|
ln -s ${buildsrht-api}/bin/api $out/bin/buildsrht-api
|
|
|
|
ln -s ${buildsrht-worker}/bin/worker $out/bin/buildsrht-worker
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
pythonImportsCheck = [ "buildsrht" ];
|
|
|
|
|
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/builds.sr.ht";
|
|
|
|
description = "Continuous integration 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 ];
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|