1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/tools/misc/kibana/6.x.nix

64 lines
1.9 KiB
Nix
Raw Normal View History

2018-08-03 11:24:38 +01:00
{ elk6Version
, enableUnfree ? true
, stdenv
, makeWrapper
, fetchurl
2019-04-09 11:34:01 +01:00
, nodejs-10_x
2018-08-03 11:24:38 +01:00
, coreutils
, which
}:
with stdenv.lib;
let
2019-04-09 11:34:01 +01:00
nodejs = nodejs-10_x;
inherit (builtins) elemAt;
info = splitString "-" stdenv.hostPlatform.system;
2018-08-03 11:24:38 +01:00
arch = elemAt info 0;
plat = elemAt info 1;
2018-08-03 11:24:38 +01:00
shas =
if enableUnfree
then {
2019-08-13 22:52:01 +01:00
x86_64-linux = "1i3zmzxihplwd8n994lfxhhgygdg3qxjqgrj1difa8w3vss0zbfn";
x86_64-darwin = "09a96ms9id77infxd9xxfs6r7j01mn0rz5yw3g9sl92j9ri7r52c";
2018-08-03 11:24:38 +01:00
}
else {
2019-08-13 22:52:01 +01:00
x86_64-linux = "166rhxr0qlv1yarj2mg1c3b8mxvhl70jhz53azq7ic6laj55q7fk";
x86_64-darwin = "0ngngkbl036p2mzwhp8qafi3aqzk398a218w12srfqny5n630vdk";
2018-08-03 11:24:38 +01:00
};
in stdenv.mkDerivation rec {
2018-08-03 11:24:38 +01:00
name = "kibana-${optionalString (!enableUnfree) "oss-"}${version}";
version = elk6Version;
src = fetchurl {
2018-08-03 11:24:38 +01:00
url = "https://artifacts.elastic.co/downloads/kibana/${name}-${plat}-${arch}.tar.gz";
2019-08-13 22:52:01 +01:00
sha256 = shas.${stdenv.hostPlatform.system} or (throw "Unknown architecture");
};
2018-11-29 16:10:15 +00:00
patches = [
2019-04-09 11:34:01 +01:00
# Kibana specifies it specifically needs nodejs 10.15.2 but nodejs in nixpkgs is at 10.15.3.
2018-11-29 16:10:15 +00:00
# The <nixpkgs/nixos/tests/elk.nix> test succeeds with this newer version so lets just
# disable the version check.
./disable-nodejs-version-check.patch
];
2015-09-18 19:46:51 +01:00
buildInputs = [ makeWrapper ];
2014-10-14 18:05:23 +01:00
installPhase = ''
2015-09-18 19:46:51 +01:00
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 \
2016-08-22 23:06:51 +01:00
--prefix PATH : "${stdenv.lib.makeBinPath [ nodejs coreutils which ]}"
2016-02-13 14:01:45 +00:00
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;
2018-08-03 11:24:38 +01:00
license = if enableUnfree then licenses.elastic else licenses.asl20;
maintainers = with maintainers; [ offline basvandijk ];
platforms = with platforms; unix;
};
}