nixpkgs-suyu/pkgs/development/tools/misc/kibana/5.x.nix

45 lines
1.5 KiB
Nix

{ stdenv, makeWrapper, fetchurl, elk5Version, nodejs, coreutils, which }:
with stdenv.lib;
let
inherit (builtins) elemAt;
archOverrides = {
"i686" = "x86";
};
info = splitString "-" stdenv.system;
arch = (elemAt info 0);
elasticArch = archOverrides."${arch}" or arch;
plat = elemAt info 1;
shas = {
"x86_64-linux" = "1a9n7s9r0klqvpyr5d3a410cchbsb0syx6cqwbhhnihqyw8dcx1i";
"i686-linux" = "0snnm5jwynvk6ahgl42yzl2jhld0ykn79rlcq9dsv2gpqnjb2mmv";
"x86_64-darwin" = "0qw3xkj3n3aja8s8n9r4hbr65jm9m6dgfjhhnrln434648rx7z4v";
};
in stdenv.mkDerivation rec {
name = "kibana-${version}";
version = elk5Version;
src = fetchurl {
url = "https://artifacts.elastic.co/downloads/kibana/${name}-${plat}-${elasticArch}.tar.gz";
sha256 = shas."${stdenv.system}" or (throw "Unknown architecture");
};
buildInputs = [ makeWrapper ];
installPhase = ''
mkdir -p $out/libexec/kibana $out/bin
mv * $out/libexec/kibana/
rm -r $out/libexec/kibana/node
makeWrapper $out/libexec/kibana/bin/kibana $out/bin/kibana \
--prefix PATH : "${stdenv.lib.makeBinPath [ nodejs coreutils which ]}"
sed -i 's@NODE=.*@NODE=${nodejs}/bin/node@' $out/libexec/kibana/bin/kibana
'';
meta = {
description = "Visualize logs and time-stamped data";
homepage = http://www.elasticsearch.org/overview/kibana;
license = licenses.asl20;
maintainers = with maintainers; [ offline rickynils ];
platforms = with platforms; unix;
};
}