{ 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 ]; }; }