2019-04-14 19:39:46 +00:00
|
|
|
{ elk7Version
|
2018-08-03 10:24:38 +00:00
|
|
|
, enableUnfree ? true
|
2021-08-30 03:23:41 +00:00
|
|
|
, lib
|
|
|
|
, stdenv
|
2018-08-03 10:24:38 +00:00
|
|
|
, makeWrapper
|
|
|
|
, fetchurl
|
2022-11-06 10:59:21 +00:00
|
|
|
, nodejs_16
|
2018-08-03 10:24:38 +00:00
|
|
|
, coreutils
|
|
|
|
, which
|
|
|
|
}:
|
2014-09-15 09:33:07 +00:00
|
|
|
|
2016-09-25 19:40:15 +00:00
|
|
|
let
|
2022-11-06 10:59:21 +00:00
|
|
|
nodejs = nodejs_16;
|
2016-09-25 19:40:15 +00:00
|
|
|
inherit (builtins) elemAt;
|
2023-01-26 17:31:02 +00:00
|
|
|
info = lib.splitString "-" stdenv.hostPlatform.system;
|
2018-08-03 10:24:38 +00:00
|
|
|
arch = elemAt info 0;
|
2016-09-25 19:40:15 +00:00
|
|
|
plat = elemAt info 1;
|
2018-08-03 10:24:38 +00:00
|
|
|
shas =
|
2021-02-26 10:32:09 +00:00
|
|
|
{
|
2022-06-01 22:15:43 +00:00
|
|
|
x86_64-linux = "b657d82c8189acc8a8f656ab949e1484aaa98755a16c33f48c318fb17180343f";
|
|
|
|
x86_64-darwin = "ac2b5a639ad83431db25e4161f811111d45db052eb845091e18f847016a34a55";
|
|
|
|
aarch64-linux = "a1f7ab9e874799bf380b94394e5bb1ce28f38019896293dde8797d74ad273e67";
|
2018-08-03 10:24:38 +00:00
|
|
|
};
|
|
|
|
|
2021-02-26 10:32:09 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "kibana";
|
2019-04-14 19:39:46 +00:00
|
|
|
version = elk7Version;
|
2014-09-15 09:33:07 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-08-30 13:50:10 +00:00
|
|
|
url = "https://artifacts.elastic.co/downloads/kibana/${pname}-${version}-${plat}-${arch}.tar.gz";
|
2019-09-08 23:38:31 +00:00
|
|
|
sha256 = shas.${stdenv.hostPlatform.system} or (throw "Unknown architecture");
|
2014-09-15 09:33:07 +00:00
|
|
|
};
|
|
|
|
|
2018-11-29 16:10:15 +00:00
|
|
|
patches = [
|
2019-04-09 10:34:01 +00: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 14:10:39 +00:00
|
|
|
./disable-nodejs-version-check-7.patch
|
2018-11-29 16:10:15 +00:00
|
|
|
];
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2014-10-14 17:05:23 +00:00
|
|
|
|
2014-09-15 09:33:07 +00:00
|
|
|
installPhase = ''
|
2015-09-18 18:46:51 +00: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 12:26:19 +00:00
|
|
|
--prefix PATH : "${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 09:33:07 +00:00
|
|
|
'';
|
|
|
|
|
2023-01-26 17:31:02 +00:00
|
|
|
meta = with lib; {
|
2014-09-15 09:33:07 +00:00
|
|
|
description = "Visualize logs and time-stamped data";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.elasticsearch.org/overview/kibana";
|
2021-02-26 10:32:09 +00:00
|
|
|
license = licenses.elastic;
|
2019-08-20 13:24:01 +00:00
|
|
|
maintainers = with maintainers; [ offline basvandijk ];
|
2016-08-02 17:50:55 +00:00
|
|
|
platforms = with platforms; unix;
|
2014-09-15 09:33:07 +00:00
|
|
|
};
|
|
|
|
}
|