summary refs log tree commit diff
path: root/pkgs/servers/nosql/influxdb/default.nix
blob: fa9c48c6ea928ea9fe98884b83456c4c52914f72 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ stdenv, fetchurl, makeWrapper }:

stdenv.mkDerivation rec {
  name = "influxdb-${version}";
  version = "0.7.0";
  arch = if stdenv.system == "x86_64-linux" then "amd64" else "386";

  src = fetchurl {
    url = "http://s3.amazonaws.com/influxdb/${name}.${arch}.tar.gz";
    sha256 = if arch == "amd64" then
        "1mvi21z83abnprzj0n8r64ly9s48i5l7ndcrci7nk96z8xab7w3q" else
        "1zgxbfnam4r31g9yfwznhb7l4hf7s5sylhll92zr8q0qjhr4cj2b";
  };

  buildInputs = [ makeWrapper ];

  installPhase = ''
    install -D influxdb $out/bin/influxdb
    patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" $out/bin/influxdb
    wrapProgram "$out/bin/influxdb" \
        --prefix LD_LIBRARY_PATH : "${stdenv.gcc.gcc}/lib:${stdenv.gcc.gcc}/lib64"

    ensureDir $out/share/influxdb
    cp -R admin scripts config.toml $out/share/influxdb
  '';

  meta = with stdenv.lib; {
    description = "Scalable datastore for metrics, events, and real-time analytics";
    homepage = http://influxdb.com/;
    license = licenses.mit;

    maintainers = [ maintainers.offline ];
    platforms = ["i686-linux" "x86_64-linux"];
  };
}