3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #34655 from markus1189/zookeeper-package-option

zookeeper.service: option for package and add to environment
This commit is contained in:
Jörg Thalheim 2018-02-10 09:54:12 +00:00 committed by GitHub
commit 7914e6be3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 { config = mkIf cfg.enable {
environment.systemPackages = [cfg.package];
systemd.services.zookeeper = { systemd.services.zookeeper = {
description = "Zookeeper Daemon"; description = "Zookeeper Daemon";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
@ -118,7 +127,7 @@ in {
serviceConfig = { serviceConfig = {
ExecStart = '' ExecStart = ''
${pkgs.jre}/bin/java \ ${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} \ ${escapeShellArgs cfg.extraCmdLineOptions} \
-Dzookeeper.datadir.autocreate=false \ -Dzookeeper.datadir.autocreate=false \
${optionalString cfg.preferIPv4 "-Djava.net.preferIPv4Stack=true"} \ ${optionalString cfg.preferIPv4 "-Djava.net.preferIPv4Stack=true"} \