2021-08-13 05:52:00 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromSourcehut
|
|
|
|
, buildGoModule
|
2022-05-05 22:08:13 +00:00
|
|
|
, unzip
|
2021-08-13 05:52:00 +00:00
|
|
|
}:
|
2021-10-23 00:23:14 +00:00
|
|
|
|
2022-05-05 22:08:13 +00:00
|
|
|
buildGoModule (rec {
|
2021-10-23 00:23:14 +00:00
|
|
|
pname = "pagessrht";
|
2024-03-30 13:18:12 +00:00
|
|
|
version = "0.15.7";
|
2021-08-13 05:52:00 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "pages.sr.ht";
|
|
|
|
rev = version;
|
2024-03-30 13:18:12 +00:00
|
|
|
hash = "sha256-Lobuf12ybSO7Y4ztOLMFW0dmPFaBSEPCy4Nmh89tylI=";
|
2021-08-13 05:52:00 +00:00
|
|
|
};
|
|
|
|
|
2022-06-02 12:48:35 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "all: server" ""
|
2024-03-30 13:18:12 +00:00
|
|
|
|
|
|
|
# fix build failure due to unused import
|
|
|
|
substituteInPlace server.go \
|
|
|
|
--replace-warn ' "fmt"' ""
|
2022-06-02 12:48:35 +00:00
|
|
|
'';
|
|
|
|
|
2024-03-30 13:18:12 +00:00
|
|
|
vendorHash = "sha256-9hpOkP6AYSZe7MW1mrwFEKq7TvVt6OcF6eHWY4jARuU=";
|
2021-08-13 05:52:00 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/sql/
|
|
|
|
cp -r -t $out/share/sql/ schema.sql migrations
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://git.sr.ht/~sircmpwn/pages.sr.ht";
|
|
|
|
description = "Web hosting service for the sr.ht network";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "pages.sr.ht";
|
2021-08-15 20:54:11 +00:00
|
|
|
license = licenses.agpl3Only;
|
2024-02-07 09:17:20 +00:00
|
|
|
maintainers = with maintainers; [ eadwu christoph-heiss ];
|
2021-08-13 05:52:00 +00:00
|
|
|
};
|
2022-05-05 22:08:13 +00:00
|
|
|
# There is no ./loaders but this does not cause troubles
|
|
|
|
# to go generate
|
2024-03-30 13:18:12 +00:00
|
|
|
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.42"; })
|