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