Merge pull request #169310 from Xiami2012/zookeeper-jre

nixos/zookeeper: Take the same JRE we build zookeeper with by default
This commit is contained in:
Robert Hensing 2022-05-02 10:51:42 +02:00 committed by GitHub
commit e4054fe0a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 3 deletions

View File

@ -1358,6 +1358,16 @@ Existing 3rd party modules that provided similar functionality, like <literal>pu
<literal>otelcorecol</literal> and enjoy a 7x smaller binary.
</para>
</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 that
<literal>pkgs.zookeeper</literal> was wrapped with, instead of
<literal>pkgs.jre</literal>. This changes the JRE to
<literal>pkgs.jdk11_headless</literal> by default.
</para>
</listitem>
<listitem>
<para>
<literal>pkgs.pgadmin</literal> now refers to

View File

@ -541,6 +541,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 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.
- `pkgs.noto-fonts-cjk` is now deprecated in favor of `pkgs.noto-fonts-cjk-sans`

View File

@ -114,6 +114,13 @@ in {
type = types.package;
};
jre = mkOption {
description = "The JRE with which to run Zookeeper";
default = cfg.package.jre;
defaultText = literalExpression "pkgs.zookeeper.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 \

View File

@ -37,8 +37,11 @@ stdenv.mkDerivation rec {
runHook postInstall
'';
passthru.tests = {
nixos = nixosTests.zookeeper;
passthru = {
tests = {
nixos = nixosTests.zookeeper;
};
inherit jre;
};
meta = with lib; {