mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Merge pull request #34655 from markus1189/zookeeper-package-option
zookeeper.service: option for package and add to environment
This commit is contained in:
commit
7914e6be3e
1 changed files with 10 additions and 1 deletions
|
@ -106,10 +106,19 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "The zookeeper package to use";
|
||||
default = pkgs.zookeeper;
|
||||
defaultText = "pkgs.zookeeper";
|
||||
type = types.package;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [cfg.package];
|
||||
|
||||
systemd.services.zookeeper = {
|
||||
description = "Zookeeper Daemon";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
@ -118,7 +127,7 @@ in {
|
|||
serviceConfig = {
|
||||
ExecStart = ''
|
||||
${pkgs.jre}/bin/java \
|
||||
-cp "${pkgs.zookeeper}/lib/*:${pkgs.zookeeper}/${pkgs.zookeeper.name}.jar:${configDir}" \
|
||||
-cp "${cfg.package}/lib/*:${cfg.package}/${cfg.package.name}.jar:${configDir}" \
|
||||
${escapeShellArgs cfg.extraCmdLineOptions} \
|
||||
-Dzookeeper.datadir.autocreate=false \
|
||||
${optionalString cfg.preferIPv4 "-Djava.net.preferIPv4Stack=true"} \
|
||||
|
|
Loading…
Reference in a new issue