summary refs log tree commit diff
path: root/pkgs/servers/nsq/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/nsq/default.nix')
-rw-r--r--pkgs/servers/nsq/default.nix39
1 files changed, 17 insertions, 22 deletions
diff --git a/pkgs/servers/nsq/default.nix b/pkgs/servers/nsq/default.nix
index 4d32c3203c7..a7b77b8802a 100644
--- a/pkgs/servers/nsq/default.nix
+++ b/pkgs/servers/nsq/default.nix
@@ -1,33 +1,28 @@
-{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
+{ lib, goPackages, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
 
-stdenv.mkDerivation rec {
+with goPackages;
+
+buildGoPackage rec {
   version = "0.2.28";
   name = "nsq-${version}";
-
-  src = import ./deps.nix {
-    inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
+  goPackagePath = "github.com/bitly/nsq";
+  src = fetchFromGitHub {
+    owner = "bitly";
+    repo = "nsq";
+    rev = "v${version}";
+    sha256 = "0drmf1j5w3q4l6f7xjy3y7d7cl50gcx0qwci6mahxsyaaclx60yx";
   };
 
-  buildInputs = [ go ];
-
-  buildPhase = ''
-    export GOPATH=$src
-    apps=(nsq_pubsub nsq_stat nsq_tail nsq_to_file nsq_to_http nsq_to_nsq nsqd nsqlookupd)
-
-    mkdir build
+  subPackages = [ "nsqadmin" ] ++
+                map (x: "apps/"+x) [ "nsq_pubsub" "nsq_stat" "nsq_tail"
+                                     "nsq_to_file" "nsq_to_http" "nsq_to_nsq"
+                                     "nsqd" "nsqlookupd" ];
 
-    go build -v -o build/nsqadmin github.com/bitly/nsq/nsqadmin
-    for app in "''${apps[@]}"; do
-      go build -v -o build/$app github.com/bitly/nsq/apps/$app
-    done
-  '';
+  buildInputs = [ go-nsq go-options toml perks go-hostpool ];
 
-  installPhase = ''
-    mkdir -p $out/bin
-    mv build/* $out/bin
-  '';
+  dontInstallSrc = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A realtime distributed messaging platform";
     homepage = http://nsq.io/;
     license = licenses.mit;