1
0

gogs.nix 1.1 KB

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