lol
1{ lib
2, fetchFromSourcehut
3, buildGoModule
4, unzip
5}:
6
7buildGoModule (rec {
8 pname = "pagessrht";
9 version = "0.15.7";
10
11 src = fetchFromSourcehut {
12 owner = "~sircmpwn";
13 repo = "pages.sr.ht";
14 rev = version;
15 hash = "sha256-Lobuf12ybSO7Y4ztOLMFW0dmPFaBSEPCy4Nmh89tylI=";
16 };
17
18 postPatch = ''
19 substituteInPlace Makefile \
20 --replace "all: server" ""
21
22 # fix build failure due to unused import
23 substituteInPlace server.go \
24 --replace-warn ' "fmt"' ""
25 '';
26
27 vendorHash = "sha256-9hpOkP6AYSZe7MW1mrwFEKq7TvVt6OcF6eHWY4jARuU=";
28
29 postInstall = ''
30 mkdir -p $out/share/sql/
31 cp -r -t $out/share/sql/ schema.sql migrations
32 '';
33
34 meta = with lib; {
35 homepage = "https://git.sr.ht/~sircmpwn/pages.sr.ht";
36 description = "Web hosting service for the sr.ht network";
37 mainProgram = "pages.sr.ht";
38 license = licenses.agpl3Only;
39 maintainers = with maintainers; [ eadwu christoph-heiss ];
40 };
41 # There is no ./loaders but this does not cause troubles
42 # to go generate
43} // import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.42"; })