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

68 lines
1.3 KiB
Nix
Raw Normal View History

2021-04-18 03:10:01 +00:00
{ lib
, fetchFromSourcehut
, buildPythonPackage
, buildGoModule
2021-04-18 03:10:01 +00:00
, srht
, redis
, celery
, pyyaml
, markdown
, ansi2html
, python
}:
let
2021-09-18 17:30:44 +00:00
version = "0.71.6";
buildWorker = src: buildGoModule {
inherit src version;
pname = "builds-sr-ht-worker";
2021-09-18 17:30:44 +00:00
vendorSha256 = "sha256-ZEarWM/33t+pNXUEIpfd/DkBkhu3UUg17Hh8XXWOepA=";
};
2021-04-18 03:10:01 +00:00
in
buildPythonPackage rec {
inherit version;
pname = "buildsrht";
2021-04-18 03:10:01 +00:00
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "builds.sr.ht";
rev = version;
2021-09-18 17:30:44 +00:00
sha256 = "sha256-c2xp2uIP8+WeRMz0efA1H58Nkot65bc03e7rrrZk3jo=";
};
nativeBuildInputs = srht.nativeBuildInputs;
propagatedBuildInputs = [
srht
redis
celery
pyyaml
markdown
2021-04-18 03:10:01 +00:00
ansi2html
];
preBuild = ''
export PKGVER=${version}
2021-04-18 03:10:01 +00:00
export SRHT_PATH=${srht}/${python.sitePackages}/srht
'';
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
cp ${buildWorker "${src}/worker"}/bin/worker $out/bin/builds.sr.ht-worker
'';
2021-08-15 21:11:47 +00:00
pythonImportsCheck = [ "buildsrht" ];
meta = with lib; {
homepage = "https://git.sr.ht/~sircmpwn/builds.sr.ht";
description = "Continuous integration service for the sr.ht network";
2021-08-15 20:54:11 +00:00
license = licenses.agpl3Only;
maintainers = with maintainers; [ eadwu ];
};
}