From 9ff0b303ff4b954748920041b4385ecc7ce1b338 Mon Sep 17 00:00:00 2001 From: Rickard Nilsson Date: Tue, 24 Jun 2014 11:01:28 +0200 Subject: [PATCH] elasticsearch: Add option specifying extra command line options --- nixos/modules/services/search/elasticsearch.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/search/elasticsearch.nix b/nixos/modules/services/search/elasticsearch.nix index 0d604850d42..3c32e4a3dfe 100644 --- a/nixos/modules/services/search/elasticsearch.nix +++ b/nixos/modules/services/search/elasticsearch.nix @@ -93,6 +93,14 @@ in { 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 @@ -104,7 +112,7 @@ in { after = [ "network-interfaces.target" ]; environment = { ES_HOME = cfg.dataDir; }; serviceConfig = { - ExecStart = "${pkgs.elasticsearch}/bin/elasticsearch -Des.path.conf=${configDir}"; + ExecStart = "${pkgs.elasticsearch}/bin/elasticsearch -Des.path.conf=${configDir} ${toString cfg.extraCmdLineOptions}"; User = "elasticsearch"; PermissionsStartOnly = true; };