1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-03 11:02:05 +00:00
nixpkgs/pkgs/applications/version-management/gogs/default.nix
2021-01-25 18:31:47 +01:00

51 lines
1 KiB
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;
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 ];
};
}