nixpkgs-suyu/pkgs/development/tools/misc/kibana/7.x.nix

64 lines
1.9 KiB
Nix
Raw Normal View History

{ elk7Version
2018-08-03 12:24:38 +02:00
, enableUnfree ? true
, stdenv
, makeWrapper
, fetchurl
2019-04-09 12:34:01 +02:00
, nodejs-10_x
2018-08-03 12:24:38 +02:00
, coreutils
, which
}:
with stdenv.lib;
let
2019-04-09 12:34:01 +02:00
nodejs = nodejs-10_x;
inherit (builtins) elemAt;
info = splitString "-" stdenv.hostPlatform.system;
2018-08-03 12:24:38 +02:00
arch = elemAt info 0;
plat = elemAt info 1;
2018-08-03 12:24:38 +02:00
shas =
if enableUnfree
then {
2019-05-09 11:37:48 +02:00
"x86_64-linux" = "1mzycd0ljnkslz9p9jhq279bkpk35r7svhngxjnmsh11ampsvxb8";
"x86_64-darwin" = "1bz409njdpmsagh5dg062114wpa96w7pmxwfjsizwksqyyjdwdv7";
2018-08-03 12:24:38 +02:00
}
else {
2019-05-09 11:37:48 +02:00
"x86_64-linux" = "1x3gjc9xa03m4jfnl5vjxigzcnb8ysnhxgd8618v85x4l0010v38";
"x86_64-darwin" = "1nsbmrswv2jv2z7686i2sf6rrmxysbqi5ih6jjrbrqnk64xi18j2";
2018-08-03 12:24:38 +02:00
};
in stdenv.mkDerivation rec {
2018-08-03 12:24:38 +02:00
name = "kibana-${optionalString (!enableUnfree) "oss-"}${version}";
version = elk7Version;
src = fetchurl {
2018-08-03 12:24:38 +02:00
url = "https://artifacts.elastic.co/downloads/kibana/${name}-${plat}-${arch}.tar.gz";
sha256 = shas."${stdenv.hostPlatform.system}" or (throw "Unknown architecture");
};
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
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
'';
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 ];
platforms = with platforms; unix;
};
}