about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/trickster/trickster.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/trickster/trickster.nix')
-rw-r--r--nixpkgs/pkgs/servers/trickster/trickster.nix53
1 files changed, 40 insertions, 13 deletions
diff --git a/nixpkgs/pkgs/servers/trickster/trickster.nix b/nixpkgs/pkgs/servers/trickster/trickster.nix
index 5cf08ee6c3cf..a798e0ceff0d 100644
--- a/nixpkgs/pkgs/servers/trickster/trickster.nix
+++ b/nixpkgs/pkgs/servers/trickster/trickster.nix
@@ -1,26 +1,53 @@
-{ lib, buildGoPackage, fetchFromGitHub }:
+{ lib
+, buildGoModule
+, fetchFromGitHub
+}:
 
-buildGoPackage rec {
+buildGoModule rec {
   pname = "trickster";
-  version = "0.1.10";
-
-  goPackagePath = "github.com/Comcast/trickster";
-
-  goDeps = ./trickster_deps.nix;
+  version = "1.1.5";
+  rev = "4595bd6a1ae1165ef497251ad85c646dadc8a925";
 
   src = fetchFromGitHub {
-    owner = "Comcast";
-    repo = pname;
+    owner = "trickstercache";
+    repo = "trickster";
     rev = "v${version}";
-    sha256 = "12z71rf03g2x8r7cgns0n4n46r0gjsfyig6z9r5xrn9kfghabfi8";
+    sha256 = "sha256-BRD8IF3s9RaDorVtXRvbKLVVVXWiEQTQyKBR9jFo1eM=";
   };
 
-  doCheck = true;
+  vendorSha256 = null;
+
+  subPackages = [ "cmd/trickster" ];
+
+  preBuild =
+    let
+      ldflags = with lib;
+        concatStringsSep " " (
+          [ "-extldflags '-static'" "-s" "-w" ] ++
+          (mapAttrsToList (n: v: "-X main.application${n}=${v}") {
+            BuildTime = "1970-01-01T00:00:00+0000";
+            GitCommitID = rev;
+            GoVersion = "$(go env GOVERSION)";
+            GoArch = "$(go env GOARCH)";
+          })
+        );
+    in
+    ''
+      buildFlagsArray+=("-ldflags=${ldflags}")
+    '';
+
+  # Tests are broken.
+  doCheck = false;
 
   meta = with lib; {
-    description = "Reverse proxy cache for the Prometheus HTTP APIv1";
-    homepage = "https://github.com/Comcast/trickster";
+    description = "Reverse proxy cache and time series dashboard accelerator";
+    longDescription = ''
+      Trickster is a fully-featured HTTP Reverse Proxy Cache for HTTP
+      applications like static file servers and web APIs.
+    '';
+    homepage = "https://trickstercache.org/";
     license = licenses.asl20;
     maintainers = with maintainers; [ _1000101 ];
+    platforms = platforms.linux;
   };
 }