2021-02-05 17:12:51 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, makeWrapper
|
2020-04-24 23:36:52 +00:00
|
|
|
, git, bash, gzip, openssh, pam
|
|
|
|
, sqliteSupport ? true
|
|
|
|
, pamSupport ? true
|
|
|
|
}:
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gogs";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "0.12.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gogs";
|
|
|
|
repo = "gogs";
|
|
|
|
rev = "v${version}";
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "sha256-I3kFRKgVMGMKgHU5VEeNai8FseN/ea6MzEP94AR2Zfo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
vendorSha256 = "sha256-3dT5D+oDd0mpJp/cP53TQcRUkmqh6g3sRBWWAUqhaAo=";
|
2020-11-30 08:33:03 +00:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper openssh ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = optional pamSupport pam;
|
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
tags =
|
2020-04-24 23:36:52 +00:00
|
|
|
( optional sqliteSupport "sqlite"
|
|
|
|
++ optional pamSupport "pam");
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
wrapProgram $out/bin/gogs \
|
2020-04-24 23:36:52 +00:00
|
|
|
--prefix PATH : ${makeBinPath [ bash git gzip openssh ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A painless self-hosted Git service";
|
|
|
|
homepage = "https://gogs.io";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.schneefux ];
|
|
|
|
};
|
|
|
|
}
|