16 info = splitString "-" stdenv.hostPlatform.system;
21 x86_64-linux = "sha512-OiWGRxaCdRxXuxE/W04v87ytzOeUEcHRjF5nyRkdqSbZSnLXUyKOYQ4fKmk4til0VBOaKZYId20XyPiu/XTXNw==";
22 x86_64-darwin = "sha512-V/vKYL96+M1lp7ZJlvuneRBePWZmucUANfUrFPMuq+fnUP4nN69RStLWcgwgt65EspFMBwKVyQbak4swV8rWxw==";
23 aarch64-linux = "sha512-fNgVRaIIGx01reNHOnGKhMOG1aYU7gC8HLpIESSbM3+9xO1q9IHIaL/ObI/w2RYj/lD22d7PAdX5N6Hd1pVSAA==";
24 aarch64-darwin = "sha512-DgexeyoxZ1YTPw9HjSUAM6eC8XtzIw7MY1WUVsIa8zl5j3RpCp25s3oI12BWefjYYCTjdtFDMsnoFSqZBabLig==";
27 stdenv.mkDerivation rec {
28 pname = "elasticsearch";
29 version = elk7Version;
32 url = "https://artifacts.elastic.co/downloads/elasticsearch/${pname}-${version}-${plat}-${arch}.tar.gz";
33 hash = hashes.${stdenv.hostPlatform.system} or (throw "Unknown architecture");
36 patches = [ ./es-home-6.x.patch ];
39 substituteInPlace bin/elasticsearch-env --replace \
40 "ES_CLASSPATH=\"\$ES_HOME/lib/*\"" \
41 "ES_CLASSPATH=\"$out/lib/*\""
43 substituteInPlace bin/elasticsearch-cli --replace \
44 "ES_CLASSPATH=\"\$ES_CLASSPATH:\$ES_HOME/\$additional_classpath_directory/*\"" \
45 "ES_CLASSPATH=\"\$ES_CLASSPATH:$out/\$additional_classpath_directory/*\""
48 nativeBuildInputs = [ makeWrapper ]
49 ++ lib.optional (!stdenv.hostPlatform.isDarwin) autoPatchelfHook;
51 buildInputs = [ jre_headless util-linux zlib ];
53 runtimeDependencies = [ zlib ];
57 cp -R bin config lib modules plugins $out
61 substituteInPlace $out/bin/elasticsearch \
62 --replace 'bin/elasticsearch-keystore' "$out/bin/elasticsearch-keystore"
64 wrapProgram $out/bin/elasticsearch \
65 --prefix PATH : "${makeBinPath [ util-linux coreutils gnugrep ]}" \
66 --set JAVA_HOME "${jre_headless}"
68 wrapProgram $out/bin/elasticsearch-plugin --set JAVA_HOME "${jre_headless}"
71 passthru = { enableUnfree = true; };
74 description = "Open Source, Distributed, RESTful Search Engine";
75 sourceProvenance = with lib.sourceTypes; [
79 license = licenses.elastic20;
80 platforms = platforms.unix;
81 maintainers = with maintainers; [ apeschar basvandijk ];