From 4978685d9e585bdb44d6ada8fb5b7814b659fa7e Mon Sep 17 00:00:00 2001 From: Xiami Date: Tue, 19 Apr 2022 18:43:53 +0800 Subject: [PATCH 1/4] zookeeper: Expose jre for nixos modules --- pkgs/servers/zookeeper/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/zookeeper/default.nix b/pkgs/servers/zookeeper/default.nix index f00c749557f1..41603da33be3 100644 --- a/pkgs/servers/zookeeper/default.nix +++ b/pkgs/servers/zookeeper/default.nix @@ -37,8 +37,11 @@ stdenv.mkDerivation rec { runHook postInstall ''; - passthru.tests = { - nixos = nixosTests.zookeeper; + passthru = { + tests = { + nixos = nixosTests.zookeeper; + }; + inherit jre; }; meta = with lib; { From 1637e039d2900e15bc6aae60b7e6af886c0ba991 Mon Sep 17 00:00:00 2001 From: Xiami Date: Tue, 19 Apr 2022 18:49:44 +0800 Subject: [PATCH 2/4] nixos/zookeeper: Take the same JRE we build zookeeper with --- .../doc/manual/from_md/release-notes/rl-2205.section.xml | 9 +++++++++ nixos/doc/manual/release-notes/rl-2205.section.md | 4 ++++ nixos/modules/services/misc/zookeeper.nix | 9 ++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) 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 4ca2666503ee..524d0d7945a5 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 @@ -1307,6 +1307,15 @@ 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 diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md index 46cc70f51249..4360f04afa46 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 3809a93a61e1..94f0d598b66b 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 \ From 3e5e584c1f7589e3525101df32a04fb76b3fe77c Mon Sep 17 00:00:00 2001 From: Xiami Date: Tue, 26 Apr 2022 18:32:32 +0800 Subject: [PATCH 3/4] nixos/zookeeper: Update doc with suggested description --- nixos/doc/manual/from_md/release-notes/rl-2205.section.xml | 7 ++++--- nixos/doc/manual/release-notes/rl-2205.section.md | 4 ++-- 2 files changed, 6 insertions(+), 5 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 524d0d7945a5..e8155410ead3 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 @@ -1311,9 +1311,10 @@ 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. + zookeeper with. It defaults to the JRE that + pkgs.zookeeper was wrapped with, instead of + pkgs.jre. This changes the JRE to + pkgs.jdk11_headless by default. diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md index 4360f04afa46..5ce11ba2afe2 100644 --- a/nixos/doc/manual/release-notes/rl-2205.section.md +++ b/nixos/doc/manual/release-notes/rl-2205.section.md @@ -519,8 +519,8 @@ In addition to numerous new and upgraded packages, this release has the followin 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`. + zookeeper with. It defaults to the JRE that `pkgs.zookeeper` was wrapped with, + instead of `pkgs.jre`. This changes the JRE to `pkgs.jdk11_headless` by default. - `pkgs.pgadmin` now refers to `pkgs.pgadmin4`. `pgadmin3` has been removed. From b43999bea087e006f92b7011abccb9ba09d1343a Mon Sep 17 00:00:00 2001 From: Xiami Date: Tue, 26 Apr 2022 18:44:33 +0800 Subject: [PATCH 4/4] nixos/zookeeper: Remove .passthru as suggested --- nixos/modules/services/misc/zookeeper.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/misc/zookeeper.nix b/nixos/modules/services/misc/zookeeper.nix index 94f0d598b66b..fefbf9a86de4 100644 --- a/nixos/modules/services/misc/zookeeper.nix +++ b/nixos/modules/services/misc/zookeeper.nix @@ -116,8 +116,8 @@ in { jre = mkOption { description = "The JRE with which to run Zookeeper"; - default = cfg.package.passthru.jre; - defaultText = literalExpression "pkgs.zookeeper.passthru.jre"; + default = cfg.package.jre; + defaultText = literalExpression "pkgs.zookeeper.jre"; example = literalExpression "pkgs.jre"; type = types.package; };