lol
1{ lib
2, buildGoModule
3, fetchFromGitHub
4}:
5
6buildGoModule rec {
7 pname = "trickster";
8 version = "1.1.5";
9 rev = "4595bd6a1ae1165ef497251ad85c646dadc8a925";
10
11 src = fetchFromGitHub {
12 owner = "trickstercache";
13 repo = "trickster";
14 rev = "v${version}";
15 sha256 = "sha256-BRD8IF3s9RaDorVtXRvbKLVVVXWiEQTQyKBR9jFo1eM=";
16 };
17
18 vendorHash = null;
19
20 subPackages = [ "cmd/trickster" ];
21
22 preBuild =
23 let
24 ldflags = with lib;
25 concatStringsSep " " (
26 [ "-extldflags '-static'" "-s" "-w" ] ++
27 (mapAttrsToList (n: v: "-X main.application${n}=${v}") {
28 BuildTime = "1970-01-01T00:00:00+0000";
29 GitCommitID = rev;
30 GoVersion = "$(go env GOVERSION)";
31 GoArch = "$(go env GOARCH)";
32 })
33 );
34 in
35 ''
36 buildFlagsArray+=("-ldflags=${ldflags}")
37 '';
38
39 # Tests are broken.
40 doCheck = false;
41
42 meta = with lib; {
43 description = "Reverse proxy cache and time series dashboard accelerator";
44 longDescription = ''
45 Trickster is a fully-featured HTTP Reverse Proxy Cache for HTTP
46 applications like static file servers and web APIs.
47 '';
48 homepage = "https://trickstercache.org/";
49 license = licenses.asl20;
50 maintainers = with maintainers; [ _1000101 ];
51 platforms = platforms.linux;
52 };
53}