sourcehut.hgsrht: 0.29.4 -> 0.31.2
This commit is contained in:
parent
b57ed0fa1d
commit
658d8f1240
2 changed files with 32 additions and 2 deletions
|
@ -1134,6 +1134,11 @@ in
|
|||
timerConfig.OnCalendar = ["daily"];
|
||||
timerConfig.AccuracySec = "1h";
|
||||
};
|
||||
extraServices.hgsrht-api = {
|
||||
serviceConfig.Restart = "always";
|
||||
serviceConfig.RestartSec = "2s";
|
||||
serviceConfig.ExecStart = "${pkgs.sourcehut.hgsrht}/bin/hgsrht-api -b ${cfg.listenAddress}:${toString (cfg.hg.port + 100)}";
|
||||
};
|
||||
extraConfig = mkMerge [
|
||||
{
|
||||
users.users.${cfg.hg.user}.shell = pkgs.bash;
|
||||
|
|
|
@ -1,21 +1,41 @@
|
|||
{ lib
|
||||
, fetchhg
|
||||
, buildGoModule
|
||||
, buildPythonPackage
|
||||
, srht
|
||||
, hglib
|
||||
, scmsrht
|
||||
, unidiff
|
||||
, python
|
||||
, unzip
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "hgsrht";
|
||||
version = "0.29.4";
|
||||
version = "0.31.2";
|
||||
|
||||
src = fetchhg {
|
||||
url = "https://hg.sr.ht/~sircmpwn/hg.sr.ht";
|
||||
rev = version;
|
||||
sha256 = "Jn9M/R5tJK/GeJDWGo3LWCK2nwsfI9zh+/yo2M+X6Sk=";
|
||||
sha256 = "F0dBykSSrlis+mumULLxvKNxD75DWR9+IDTYbmhkMDI=";
|
||||
};
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "all: api hgsrht-keys" ""
|
||||
'';
|
||||
|
||||
hgsrht-api = buildGoModule ({
|
||||
inherit src version;
|
||||
pname = "hgsrht-api";
|
||||
modRoot = "api";
|
||||
vendorSha256 = "sha256-W7A22qSIgJgcfS7xYNrmbYKaZBXbDtPilM9I6DxmTeU=";
|
||||
} // import ./fix-gqlgen-trimpath.nix {inherit unzip;});
|
||||
|
||||
hgsrht-keys = buildGoModule {
|
||||
inherit src version;
|
||||
pname = "hgsrht-keys";
|
||||
modRoot = "hgsrht-keys";
|
||||
vendorSha256 = "sha256-7ti8xCjSrxsslF7/1X/GY4FDl+69hPL4UwCDfjxmJLU=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = srht.nativeBuildInputs;
|
||||
|
@ -32,6 +52,11 @@ buildPythonPackage rec {
|
|||
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
ln -s ${hgsrht-api}/bin/api $out/bin/hgsrht-api
|
||||
ln -s ${hgsrht-keys}/bin/hgsrht-keys $out/bin/hgsrht-keys
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "hgsrht" ];
|
||||
|
||||
meta = with lib; {
|
||||
|
|
Loading…
Reference in a new issue