3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/version-management/gogs/default.nix
2020-11-28 06:50:52 +01:00

51 lines
1 KiB
Nix

{ stdenv, buildGoModule, fetchFromGitHub, makeWrapper
, git, bash, gzip, openssh, pam
, sqliteSupport ? true
, pamSupport ? true
}:
with stdenv.lib;
buildGoModule rec {
pname = "gogs";
version = "0.12.3";
src = fetchFromGitHub {
owner = "gogs";
repo = "gogs";
rev = "v${version}";
sha256 = "0ix3mxy8cpqbx24qffbzyf5z88x7605icm7rk5n54r8bdsr7cckd";
};
vendorSha256 = "0m0g4dsiq8p2ngsbjxfi3wff7x4xpm67qlhgcgf8b48mqai4d2gc";
subPackages = [ "." ];
postPatch = ''
patchShebangs .
'';
nativeBuildInputs = [ makeWrapper openssh ];
buildInputs = optional pamSupport pam;
buildFlags = [ "-tags" ];
buildFlagsArray =
( optional sqliteSupport "sqlite"
++ optional pamSupport "pam");
postInstall = ''
wrapProgram $out/bin/gogs \
--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 ];
};
}