nixpkgs/pkgs/applications/version-management/gogs/default.nix

51 lines
1.0 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub, makeWrapper
2018-12-22 16:52:39 -08:00
, git, bash, gzip, openssh, pam
2016-10-10 08:11:58 -07:00
, sqliteSupport ? true
2018-12-22 16:52:39 -08:00
, pamSupport ? true
2016-10-10 08:11:58 -07:00
}:
2016-02-28 20:00:45 -08:00
2021-01-15 05:21:58 -08:00
with lib;
2017-03-22 14:52:52 -07:00
2020-10-29 07:30:57 -07:00
buildGoModule rec {
pname = "gogs";
2020-10-29 07:30:57 -07:00
version = "0.12.3";
2016-10-10 08:11:58 -07:00
src = fetchFromGitHub {
2018-08-30 05:43:49 -07:00
owner = "gogs";
2016-10-10 08:11:58 -07:00
repo = "gogs";
rev = "v${version}";
2020-10-29 07:30:57 -07:00
sha256 = "0ix3mxy8cpqbx24qffbzyf5z88x7605icm7rk5n54r8bdsr7cckd";
2016-10-10 08:11:58 -07:00
};
2020-10-29 07:30:57 -07:00
vendorSha256 = "0m0g4dsiq8p2ngsbjxfi3wff7x4xpm67qlhgcgf8b48mqai4d2gc";
subPackages = [ "." ];
postPatch = ''
2017-03-22 14:52:52 -07:00
patchShebangs .
'';
2016-02-28 20:00:45 -08:00
2020-10-29 07:30:57 -07:00
nativeBuildInputs = [ makeWrapper openssh ];
2020-03-18 02:26:23 -07:00
buildInputs = optional pamSupport pam;
2016-10-10 08:11:58 -07:00
buildFlags = [ "-tags" ];
buildFlagsArray =
( optional sqliteSupport "sqlite"
++ optional pamSupport "pam");
2016-10-10 08:11:58 -07:00
postInstall = ''
wrapProgram $out/bin/gogs \
2017-10-02 12:04:32 -07:00
--prefix PATH : ${makeBinPath [ bash git gzip openssh ]}
2016-02-28 20:00:45 -08:00
'';
2016-10-10 08:11:58 -07:00
meta = {
description = "A painless self-hosted Git service";
homepage = "https://gogs.io";
2017-03-22 14:52:52 -07:00
license = licenses.mit;
maintainers = [ maintainers.schneefux ];
2016-10-10 08:11:58 -07:00
};
2016-02-28 20:00:45 -08:00
}