summary refs log tree commit diff
path: root/pkgs/servers/etcd
diff options
context:
space:
mode:
authorCharles Strahan <charles.c.strahan@gmail.com>2014-06-23 04:55:46 -0400
committerCharles Strahan <charles.c.strahan@gmail.com>2014-06-23 04:55:46 -0400
commitb6df637e86d2ff0861d38bc25613c0f62dd302c1 (patch)
treebb5e9a94e936fb200fd6731940ad63a46086a5a3 /pkgs/servers/etcd
parent7301dd44dea6778e301c1ece6c2dc7181280d4e9 (diff)
downloadnixpkgs-b6df637e86d2ff0861d38bc25613c0f62dd302c1.tar
nixpkgs-b6df637e86d2ff0861d38bc25613c0f62dd302c1.tar.gz
nixpkgs-b6df637e86d2ff0861d38bc25613c0f62dd302c1.tar.bz2
nixpkgs-b6df637e86d2ff0861d38bc25613c0f62dd302c1.tar.lz
nixpkgs-b6df637e86d2ff0861d38bc25613c0f62dd302c1.tar.xz
nixpkgs-b6df637e86d2ff0861d38bc25613c0f62dd302c1.tar.zst
nixpkgs-b6df637e86d2ff0861d38bc25613c0f62dd302c1.zip
add etcd package
Diffstat (limited to 'pkgs/servers/etcd')
-rw-r--r--pkgs/servers/etcd/default.nix30
-rw-r--r--pkgs/servers/etcd/deps.nix54
2 files changed, 84 insertions, 0 deletions
diff --git a/pkgs/servers/etcd/default.nix b/pkgs/servers/etcd/default.nix
new file mode 100644
index 00000000000..1fb21f2b8ab
--- /dev/null
+++ b/pkgs/servers/etcd/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  version = "0.4.3";
+  name = "etcd-${version}";
+
+  src = import ./deps.nix {
+    inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
+  };
+
+  buildInputs = [ go ];
+
+  buildPhase = ''
+    export GOPATH=$src
+    go build -v -o etcd github.com/coreos/etcd
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin
+    mv etcd $out/bin/etcd
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A highly-available key value store for shared configuration and service discovery";
+    homepage = http://coreos.com/using-coreos/etcd/;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ cstrahan ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/servers/etcd/deps.nix b/pkgs/servers/etcd/deps.nix
new file mode 100644
index 00000000000..e9fd4a50d3e
--- /dev/null
+++ b/pkgs/servers/etcd/deps.nix
@@ -0,0 +1,54 @@
+{ stdenv, lib, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
+
+let
+  goDeps = [
+    {
+      root = "github.com/coreos/etcd";
+      src = fetchFromGitHub {
+        owner = "coreos";
+        repo = "etcd";
+        rev = "9970141f76241c909977af7bafe7b6f2c4923de8";
+        sha256 = "1bva46gfy4rkfw8k8pb3lsfzfg16csds01f0nvfrkh99pr7sp0sy";
+      };
+    }
+    {
+      root = "github.com/stathat/go";
+      src = fetchFromGitHub {
+        owner = "stathat";
+        repo = "go";
+        rev = "01d012b9ee2ecc107cb28b6dd32d9019ed5c1d77";
+        sha256 = "0mrn70wjfcs4rfkmga3hbfqmbjk33skcsc8pyqxp02bzpwdpc4bi";
+      };
+    }
+    {
+      root = "github.com/stretchr/objx";
+      src = fetchFromGitHub {
+        owner = "stretchr";
+        repo = "objx";
+        rev = "cbeaeb16a013161a98496fad62933b1d21786672";
+        sha256 = "1xn7iibjik77h6h0jilfvcjkkzaqz45baf44p3rb2i03hbmkqkp1";
+      };
+    }
+    {
+      root = "github.com/stretchr/testify";
+      src = fetchFromGitHub {
+        owner = "stretchr";
+        repo = "testify";
+        rev = "3e03dde72495487a4deb74152ac205d0619fbc8d";
+        sha256 = "1xd9sbi6y68cfwkxgybcz0dbfx4r6jmxq51wjj6six3wm9p7m8ls";
+      };
+    }
+  ];
+
+in
+
+stdenv.mkDerivation rec {
+  name = "go-deps";
+
+  buildCommand =
+    lib.concatStrings
+      (map (dep: ''
+              mkdir -p $out/src/`dirname ${dep.root}`
+              ln -s ${dep.src} $out/src/${dep.root}
+            '') goDeps);
+}