summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/co/codeberg-pages/package.nix
blob: 542b77a6909f9464e264555fb5e0d22cc38f4570 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
  lib,
  fetchFromCodeberg,
  buildGoModule,
  nix-update-script,
}:

buildGoModule (finalAttrs: {
  pname = "codeberg-pages";
  version = "6.4";

  src = fetchFromCodeberg {
    owner = "Codeberg";
    repo = "pages-server";
    rev = "v${finalAttrs.version}";
    hash = "sha256-xNsob0fW6SaqVKBIgRFj0YZUymHKWWfWZ5UqGkHWOmA=";
  };

  vendorHash = "sha256-nSFUBIO3ssnwVHcjHRgUWjIK+swZP9PEJOTwM7esIgo=";

  postPatch = ''
    # disable httptest
    rm server/handler/handler_test.go
  '';

  ldflags = [
    "-s"
    "-w"
    "-X"
    "codeberg.org/codeberg/pages/server/version.Version=${finalAttrs.version}"
  ];

  tags = [
    "sqlite"
    "sqlite_unlock_notify"
    "netgo"
  ];

  passthru.updateScript = nix-update-script { };

  meta = {
    mainProgram = "pages";
    maintainers = with lib.maintainers; [
      christoph-heiss
    ];
    license = lib.licenses.eupl12;
    homepage = "https://codeberg.org/Codeberg/pages-server";
    description = "Static websites hosting from Gitea repositories";
    changelog = "https://codeberg.org/Codeberg/pages-server/releases/tag/v${finalAttrs.version}";
  };
})