2018-08-03 12:24:38 +02:00
|
|
|
{ elk6Version
|
|
|
|
, enableUnfree ? true
|
|
|
|
, stdenv
|
|
|
|
, makeWrapper
|
|
|
|
, fetchzip
|
|
|
|
, fetchurl
|
2019-04-09 12:34:01 +02:00
|
|
|
, nodejs-10_x
|
2018-08-03 12:24:38 +02:00
|
|
|
, coreutils
|
|
|
|
, which
|
|
|
|
}:
|
2014-09-15 11:33:07 +02:00
|
|
|
|
|
|
|
with stdenv.lib;
|
2016-09-25 21:40:15 +02:00
|
|
|
let
|
2019-04-09 12:34:01 +02:00
|
|
|
nodejs = nodejs-10_x;
|
2016-09-25 21:40:15 +02:00
|
|
|
inherit (builtins) elemAt;
|
2018-08-20 21:11:29 +02:00
|
|
|
info = splitString "-" stdenv.hostPlatform.system;
|
2018-08-03 12:24:38 +02:00
|
|
|
arch = elemAt info 0;
|
2016-09-25 21:40:15 +02:00
|
|
|
plat = elemAt info 1;
|
2018-08-03 12:24:38 +02:00
|
|
|
shas =
|
|
|
|
if enableUnfree
|
|
|
|
then {
|
2019-04-09 12:34:01 +02:00
|
|
|
"x86_64-linux" = "039ll00kvrp881cyybb04z90cw68j7p5cspgdxh0bky9lyi9qpwb";
|
|
|
|
"x86_64-darwin" = "0qrakrihcjwn9dic77b0k9ja3zf6nbz534v76xid9gv20md5dds3";
|
2018-08-03 12:24:38 +02:00
|
|
|
}
|
|
|
|
else {
|
2019-04-09 12:34:01 +02:00
|
|
|
"x86_64-linux" = "1v1fbmfkbnlx043z3yx02gaqqy63bj2ymvcby66n4qq0vlpahvwx";
|
|
|
|
"x86_64-darwin" = "1y4q7a2b9arln94d6sj547qkv3258jlgcz9b342fh6khlbpfjb8c";
|
2018-08-03 12:24:38 +02:00
|
|
|
};
|
|
|
|
|
2016-09-25 21:40:15 +02:00
|
|
|
in stdenv.mkDerivation rec {
|
2018-08-03 12:24:38 +02:00
|
|
|
name = "kibana-${optionalString (!enableUnfree) "oss-"}${version}";
|
|
|
|
version = elk6Version;
|
2014-09-15 11:33:07 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-08-03 12:24:38 +02:00
|
|
|
url = "https://artifacts.elastic.co/downloads/kibana/${name}-${plat}-${arch}.tar.gz";
|
2018-08-20 21:11:29 +02:00
|
|
|
sha256 = shas."${stdenv.hostPlatform.system}" or (throw "Unknown architecture");
|
2014-09-15 11:33:07 +02:00
|
|
|
};
|
|
|
|
|
2018-11-29 17:10:15 +01:00
|
|
|
patches = [
|
2019-04-09 12:34:01 +02:00
|
|
|
# Kibana specifies it specifically needs nodejs 10.15.2 but nodejs in nixpkgs is at 10.15.3.
|
2018-11-29 17:10:15 +01: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 20:46:51 +02:00
|
|
|
buildInputs = [ makeWrapper ];
|
2014-10-14 19:05:23 +02:00
|
|
|
|
2014-09-15 11:33:07 +02:00
|
|
|
installPhase = ''
|
2015-09-18 20:46:51 +02: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-23 00:06:51 +02:00
|
|
|
--prefix PATH : "${stdenv.lib.makeBinPath [ nodejs coreutils which ]}"
|
2016-02-13 15:01:45 +01:00
|
|
|
sed -i 's@NODE=.*@NODE=${nodejs}/bin/node@' $out/libexec/kibana/bin/kibana
|
2014-09-15 11:33:07 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Visualize logs and time-stamped data";
|
|
|
|
homepage = http://www.elasticsearch.org/overview/kibana;
|
2018-08-03 12:24:38 +02:00
|
|
|
license = if enableUnfree then licenses.elastic else licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ offline rickynils basvandijk ];
|
2016-08-02 19:50:55 +02:00
|
|
|
platforms = with platforms; unix;
|
2014-09-15 11:33:07 +02:00
|
|
|
};
|
|
|
|
}
|