gogs.nix 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {
  2. lib,
  3. fetchFromGitHub,
  4. buildGoModule,
  5. makeWrapper,
  6. git,
  7. openssh,
  8. pam,
  9. stdenv,
  10. }:
  11. buildGoModule rec {
  12. pname = "gogs";
  13. version = "0.14.3";
  14. src = fetchFromGitHub {
  15. owner = "gogs";
  16. repo = "gogs";
  17. rev = "v${version}";
  18. hash = "sha256-/WWOH6Tx/zxhYJlIaK6kcEKUUzUXOT30ONAx1FpZLMY=";
  19. };
  20. vendorHash = "sha256-k+PdCynhcnerlk7Ut+GbA0P7KEC/eDW8RY1tCmIEeWQ=";
  21. nativeBuildInputs = [ makeWrapper ];
  22. buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ pam ];
  23. tags = [
  24. "cert"
  25. "sqlite"
  26. ]
  27. ++ lib.optionals stdenv.hostPlatform.isLinux [ "pam" ];
  28. subPackages = [ "." ];
  29. postInstall = ''
  30. mkdir -p $out/share/gogs
  31. cp -r conf templates public $out/share/gogs/
  32. wrapProgram $out/bin/gogs \
  33. --prefix PATH : ${lib.makeBinPath [ git openssh ]}
  34. '';
  35. meta = {
  36. description = "Painless self-hosted Git service customized for isolated environment execution";
  37. homepage = "https://gogs.io";
  38. license = lib.licenses.mit;
  39. platforms = lib.platforms.unix;
  40. mainProgram = "gogs";
  41. };
  42. }