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-04-15 01:41:22 +00:00
|
|
|
version = "0.12.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gogs";
|
|
|
|
repo = "gogs";
|
|
|
|
rev = "v${version}";
|
2022-04-15 01:41:22 +00:00
|
|
|
sha256 = "sha256-nAMnsRYYS5bZhLDzPdC4sj3rv1kPjckFnLoORY1HqW8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
vendorSha256 = "sha256-U8rzYSLD9XeO5ai3p3OG74kPRI2IAlvOeZhU1Pa1BAI=";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|