2019-04-14 20:39:46 +01:00
|
|
|
{ elk7Version
|
2018-08-03 11:24:38 +01:00
|
|
|
, 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
|
|
|
|
}:
|
2014-09-15 10:33:07 +01:00
|
|
|
|
|
|
|
with stdenv.lib;
|
2016-09-25 20:40:15 +01:00
|
|
|
let
|
2019-04-09 11:34:01 +01:00
|
|
|
nodejs = nodejs-10_x;
|
2016-09-25 20:40:15 +01:00
|
|
|
inherit (builtins) elemAt;
|
2018-08-20 20:11:29 +01:00
|
|
|
info = splitString "-" stdenv.hostPlatform.system;
|
2018-08-03 11:24:38 +01:00
|
|
|
arch = elemAt info 0;
|
2016-09-25 20:40:15 +01:00
|
|
|
plat = elemAt info 1;
|
2018-08-03 11:24:38 +01:00
|
|
|
shas =
|
|
|
|
if enableUnfree
|
|
|
|
then {
|
2019-09-09 00:38:31 +01:00
|
|
|
x86_64-linux = "0sc5709k3z7lb8qcjpj49s6vfv69ds2wc8319ag9x776nyz1pqxi";
|
|
|
|
x86_64-darwin = "0zh4q46vfdwaihs838ck8fap92i3b4x10wbpmx8mcwyfk5v0fkch";
|
2018-08-03 11:24:38 +01:00
|
|
|
}
|
|
|
|
else {
|
2019-09-09 00:38:31 +01:00
|
|
|
x86_64-linux = "1pq17fasryharvw4byybvmcf5172hcmy6cp0m8bxhkxagwilprba";
|
|
|
|
x86_64-darwin = "11crpx2qs2nzkzv6fvs1gqn9v4zalxkzsc5br0fy1y02lzm26zbm";
|
2018-08-03 11:24:38 +01:00
|
|
|
};
|
|
|
|
|
2016-09-25 20:40:15 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
2018-08-03 11:24:38 +01:00
|
|
|
name = "kibana-${optionalString (!enableUnfree) "oss-"}${version}";
|
2019-04-14 20:39:46 +01:00
|
|
|
version = elk7Version;
|
2014-09-15 10:33:07 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-08-03 11:24:38 +01:00
|
|
|
url = "https://artifacts.elastic.co/downloads/kibana/${name}-${plat}-${arch}.tar.gz";
|
2019-09-09 00:38:31 +01:00
|
|
|
sha256 = shas.${stdenv.hostPlatform.system} or (throw "Unknown architecture");
|
2014-09-15 10:33:07 +01:00
|
|
|
};
|
|
|
|
|
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.
|
2019-09-06 15:10:39 +01:00
|
|
|
./disable-nodejs-version-check-7.patch
|
2018-11-29 16:10:15 +00:00
|
|
|
];
|
|
|
|
|
2015-09-18 19:46:51 +01:00
|
|
|
buildInputs = [ makeWrapper ];
|
2014-10-14 18:05:23 +01:00
|
|
|
|
2014-09-15 10:33:07 +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
|
2014-09-15 10:33:07 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
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;
|
2019-08-20 14:24:01 +01:00
|
|
|
maintainers = with maintainers; [ offline basvandijk ];
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = with platforms; unix;
|
2014-09-15 10:33:07 +01:00
|
|
|
};
|
|
|
|
}
|