1 { lib, stdenv, fetchurl, jdk17_headless, jdk11_headless, makeWrapper, bash, coreutils, gnugrep, gnused, ps, nixosTests }:
6 kafkaVersion = "3.8.0";
8 sha256 = "sha256-4Cl8xv2wnvnZkFdRsl0rYpwXUo+GKbYFYe7/h84pCZw=";
10 nixosTest = nixosTests.kafka.kafka_3_8;
13 kafkaVersion = "3.7.1";
14 scalaVersion = "2.13";
15 sha256 = "sha256-YqyuShQ92YPcfrSATVdEugxQsZm1CPWZ7wAQIOJVj8k=";
17 nixosTest = nixosTests.kafka.kafka_3_7;
20 kafkaVersion = "3.6.2";
21 scalaVersion = "2.13";
22 sha256 = "sha256-wxfkf3cUHTFG6VY9nLodZIbIHmcLIR7OasRqn3Lkqqw=";
24 nixosTest = nixosTests.kafka.kafka_3_6;
28 build = versionInfo: stdenv.mkDerivation rec {
29 version = "${versionInfo.scalaVersion}-${versionInfo.kafkaVersion}";
30 pname = "apache-kafka";
33 url = "mirror://apache/kafka/${versionInfo.kafkaVersion}/kafka_${version}.tgz";
34 inherit (versionInfo) sha256;
37 nativeBuildInputs = [ makeWrapper ];
38 buildInputs = [ versionInfo.jre bash gnugrep gnused coreutils ps ];
42 cp -R config libs $out
45 cp bin/kafka* $out/bin
46 cp bin/connect* $out/bin
48 # allow us the specify logging directory using env
49 substituteInPlace $out/bin/kafka-run-class.sh \
50 --replace 'LOG_DIR="$base_dir/logs"' 'LOG_DIR="$KAFKA_LOG_DIR"'
52 substituteInPlace $out/bin/kafka-server-stop.sh \
53 --replace 'ps' '${ps}/bin/ps'
55 for p in $out/bin\/*.sh; do
57 --set JAVA_HOME "${versionInfo.jre}" \
58 --set KAFKA_LOG_DIR "/tmp/apache-kafka-logs" \
59 --prefix PATH : "${bash}/bin:${coreutils}/bin:${gnugrep}/bin:${gnused}/bin"
65 inherit (versionInfo) jre; # Used by the NixOS module to select the supported JRE
66 tests.nixos = versionInfo.nixosTest;
70 homepage = "https://kafka.apache.org";
71 description = "High-throughput distributed messaging system";
72 license = lib.licenses.asl20;
73 sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
74 maintainers = [ lib.maintainers.ragge ];
75 platforms = lib.platforms.unix;
79 (majorVersion: versionInfo: lib.nameValuePair "apacheKafka_${majorVersion}" (build versionInfo))