2019-04-14 21:39:46 +02:00
|
|
|
{ elk7Version
|
2018-08-03 12:24:38 +02:00
|
|
|
, enableUnfree ? true
|
2021-08-30 05:23:41 +02:00
|
|
|
, lib
|
|
|
|
, stdenv
|
2018-08-03 12:24:38 +02:00
|
|
|
, makeWrapper
|
|
|
|
, fetchurl
|
2021-02-26 11:32:09 +01:00
|
|
|
, nodejs-14_x
|
2018-08-03 12:24:38 +02:00
|
|
|
, coreutils
|
|
|
|
, which
|
|
|
|
}:
|
2014-09-15 11:33:07 +02:00
|
|
|
|
2021-01-23 13:26:19 +01:00
|
|
|
with lib;
|
2016-09-25 21:40:15 +02:00
|
|
|
let
|
2021-02-26 11:32:09 +01:00
|
|
|
nodejs = nodejs-14_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 =
|
2021-02-26 11:32:09 +01:00
|
|
|
{
|
|
|
|
x86_64-linux = "19p9s4sir982bb1zcldrbphhwfs9i11p0q28vgc421iqg10kjlf1";
|
|
|
|
x86_64-darwin = "0qq557ngwwakifidyrccga4cadj9k9pzhjwy4msmbcgf5pb86qyc";
|
|
|
|
aarch64-linux = "183cp1h8d3n7xfcpcys4hf36palczxa409afyp62kzyzckngy0j8";
|
2018-08-03 12:24:38 +02:00
|
|
|
};
|
|
|
|
|
2021-02-26 11:32:09 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "kibana";
|
2019-04-14 21:39:46 +02:00
|
|
|
version = elk7Version;
|
2014-09-15 11:33:07 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-08-30 15:50:10 +02:00
|
|
|
url = "https://artifacts.elastic.co/downloads/kibana/${pname}-${version}-${plat}-${arch}.tar.gz";
|
2019-09-09 01:38:31 +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.
|
2019-09-06 16:10:39 +02:00
|
|
|
./disable-nodejs-version-check-7.patch
|
2018-11-29 17:10:15 +01:00
|
|
|
];
|
|
|
|
|
2021-02-07 10:17:39 +01:00
|
|
|
nativeBuildInputs = [ 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 \
|
2021-01-23 13:26:19 +01:00
|
|
|
--prefix PATH : "${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";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.elasticsearch.org/overview/kibana";
|
2021-02-26 11:32:09 +01:00
|
|
|
license = licenses.elastic;
|
2019-08-20 15:24:01 +02:00
|
|
|
maintainers = with maintainers; [ offline basvandijk ];
|
2016-08-02 19:50:55 +02:00
|
|
|
platforms = with platforms; unix;
|
2014-09-15 11:33:07 +02:00
|
|
|
};
|
|
|
|
}
|