nixpkgs/pkgs/applications/version-management/gogs/default.nix
2021-08-08 10:17:23 +10:00

49 lines
988 B
Nix

{ lib, buildGoModule, fetchFromGitHub, makeWrapper
, git, bash, gzip, openssh, pam
, sqliteSupport ? true
, pamSupport ? true
}:
with 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;
tags =
( 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 ];
};
}