From fd02940262ab3b263bc979f6e28c6ed74ed9b41c Mon Sep 17 00:00:00 2001 From: Sarah Brofeldt Date: Tue, 22 Sep 2020 08:30:29 +0200 Subject: [PATCH] nixos/apache-kafka: Use version-matched jre --- nixos/doc/manual/release-notes/rl-2105.xml | 15 +++++++++++++++ nixos/modules/services/misc/apache-kafka.nix | 9 ++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/nixos/doc/manual/release-notes/rl-2105.xml b/nixos/doc/manual/release-notes/rl-2105.xml index 9a1e6b6618d..e052632ecaf 100644 --- a/nixos/doc/manual/release-notes/rl-2105.xml +++ b/nixos/doc/manual/release-notes/rl-2105.xml @@ -562,6 +562,21 @@ self: super: no longer uses the deprecated cirrus and vesa device dependent X drivers by default. It also enables both amdgpu and nouveau drivers by default now. + + + The apacheKafka packages are now built with + version-matched JREs. Versions 2.6 and above, the ones that recommend it, + use jdk11, while versions below remain on jdk8. The NixOS service has + been adjusted to start the service using the same version as the package, + adjustable with the new + services.apache-kafka.jre + option. Furthermore, the default list of + services.apache-kafka.jvmOptions + have been removed. You should set your own according to the + upstream documentation + for your Kafka version. + + diff --git a/nixos/modules/services/misc/apache-kafka.nix b/nixos/modules/services/misc/apache-kafka.nix index c1644c8f365..69dfadfe54e 100644 --- a/nixos/modules/services/misc/apache-kafka.nix +++ b/nixos/modules/services/misc/apache-kafka.nix @@ -106,6 +106,13 @@ in { type = types.package; }; + jre = mkOption { + description = "The JRE with which to run Kafka"; + default = cfg.package.passthru.jre; + defaultText = "pkgs.apacheKafka.passthru.jre"; + type = types.package; + }; + }; config = mkIf cfg.enable { @@ -126,7 +133,7 @@ in { after = [ "network.target" ]; serviceConfig = { ExecStart = '' - ${pkgs.jre}/bin/java \ + ${cfg.jre}/bin/java \ -cp "${cfg.package}/libs/*" \ -Dlog4j.configuration=file:${logConfig} \ ${toString cfg.jvmOptions} \