elasticsearch: Add option specifying extra command line options

This commit is contained in:
Rickard Nilsson 2014-06-24 11:01:28 +02:00
parent 94deea2035
commit 9ff0b303ff

View File

@ -93,6 +93,14 @@ in {
Data directory for elasticsearch. Data directory for elasticsearch.
''; '';
}; };
extraCmdLineOptions = mkOption {
description = "Extra command line options for the elasticsearch launcher";
default = [];
type = types.listOf types.string;
example = [ "-Djava.net.preferIPv4Stack=true" ];
};
}; };
###### implementation ###### implementation
@ -104,7 +112,7 @@ in {
after = [ "network-interfaces.target" ]; after = [ "network-interfaces.target" ];
environment = { ES_HOME = cfg.dataDir; }; environment = { ES_HOME = cfg.dataDir; };
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.elasticsearch}/bin/elasticsearch -Des.path.conf=${configDir}"; ExecStart = "${pkgs.elasticsearch}/bin/elasticsearch -Des.path.conf=${configDir} ${toString cfg.extraCmdLineOptions}";
User = "elasticsearch"; User = "elasticsearch";
PermissionsStartOnly = true; PermissionsStartOnly = true;
}; };