summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorXiami <i@f2light.com>2022-04-19 18:49:44 +0800
committerXiami <i@f2light.com>2022-04-19 18:56:00 +0800
commit1637e039d2900e15bc6aae60b7e6af886c0ba991 (patch)
tree3479c550850427415a376b323b88bcc6b0c1282d /nixos
parent4978685d9e585bdb44d6ada8fb5b7814b659fa7e (diff)
downloadnixpkgs-1637e039d2900e15bc6aae60b7e6af886c0ba991.tar
nixpkgs-1637e039d2900e15bc6aae60b7e6af886c0ba991.tar.gz
nixpkgs-1637e039d2900e15bc6aae60b7e6af886c0ba991.tar.bz2
nixpkgs-1637e039d2900e15bc6aae60b7e6af886c0ba991.tar.lz
nixpkgs-1637e039d2900e15bc6aae60b7e6af886c0ba991.tar.xz
nixpkgs-1637e039d2900e15bc6aae60b7e6af886c0ba991.tar.zst
nixpkgs-1637e039d2900e15bc6aae60b7e6af886c0ba991.zip
nixos/zookeeper: Take the same JRE we build zookeeper with
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/from_md/release-notes/rl-2205.section.xml9
-rw-r--r--nixos/doc/manual/release-notes/rl-2205.section.md4
-rw-r--r--nixos/modules/services/misc/zookeeper.nix9
3 files changed, 21 insertions, 1 deletions
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
index 4ca2666503e..524d0d7945a 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
@@ -1309,6 +1309,15 @@
       </listitem>
       <listitem>
         <para>
+          <literal>services.zookeeper</literal> has a new option
+          <literal>jre</literal> for specifying the JRE to start
+          zookeeper with. It defaults to the JRE built with
+          <literal>pkgs.zookeeper</literal> instead of
+          <literal>pkgs.jre</literal>.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
           <literal>pkgs.pgadmin</literal> now refers to
           <literal>pkgs.pgadmin4</literal>. <literal>pgadmin3</literal>
           has been removed.
diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md
index 46cc70f5124..4360f04afa4 100644
--- a/nixos/doc/manual/release-notes/rl-2205.section.md
+++ b/nixos/doc/manual/release-notes/rl-2205.section.md
@@ -518,6 +518,10 @@ In addition to numerous new and upgraded packages, this release has the followin
   you should change the package you refer to. If you don't need them update your
   commands from `otelcontribcol` to `otelcorecol` and enjoy a 7x smaller binary.
 
+- `services.zookeeper` has a new option `jre` for specifying the JRE to start
+  zookeeper with. It defaults to the JRE built with `pkgs.zookeeper` instead of
+  `pkgs.jre`.
+
 - `pkgs.pgadmin` now refers to `pkgs.pgadmin4`. `pgadmin3` has been removed.
 
 - `pkgs.noto-fonts-cjk` is now deprecated in favor of `pkgs.noto-fonts-cjk-sans`
diff --git a/nixos/modules/services/misc/zookeeper.nix b/nixos/modules/services/misc/zookeeper.nix
index 3809a93a61e..94f0d598b66 100644
--- a/nixos/modules/services/misc/zookeeper.nix
+++ b/nixos/modules/services/misc/zookeeper.nix
@@ -114,6 +114,13 @@ in {
       type = types.package;
     };
 
+    jre = mkOption {
+      description = "The JRE with which to run Zookeeper";
+      default = cfg.package.passthru.jre;
+      defaultText = literalExpression "pkgs.zookeeper.passthru.jre";
+      example = literalExpression "pkgs.jre";
+      type = types.package;
+    };
   };
 
 
@@ -131,7 +138,7 @@ in {
       after = [ "network.target" ];
       serviceConfig = {
         ExecStart = ''
-          ${pkgs.jre}/bin/java \
+          ${cfg.jre}/bin/java \
             -cp "${cfg.package}/lib/*:${configDir}" \
             ${escapeShellArgs cfg.extraCmdLineOptions} \
             -Dzookeeper.datadir.autocreate=false \