From 79c1bbf0501c956e3a932b968453b533ebed76c1 Mon Sep 17 00:00:00 2001 From: Susan Potter Date: Tue, 15 Sep 2015 15:49:04 -0500 Subject: [PATCH] Add package option to elasticsearch NixOS module --- nixos/modules/services/search/elasticsearch.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/search/elasticsearch.nix b/nixos/modules/services/search/elasticsearch.nix index 64620bf16041..3436bd01d848 100644 --- a/nixos/modules/services/search/elasticsearch.nix +++ b/nixos/modules/services/search/elasticsearch.nix @@ -37,6 +37,12 @@ in { type = types.bool; }; + package = mkOption { + description = "Elasticsearch package to use."; + default = pkgs.elasticsearch; + type = types.package; + }; + host = mkOption { description = "Elasticsearch listen address."; default = "127.0.0.1"; @@ -123,7 +129,7 @@ in { after = [ "network-interfaces.target" ]; environment = { ES_HOME = cfg.dataDir; }; serviceConfig = { - ExecStart = "${pkgs.elasticsearch}/bin/elasticsearch -Des.path.conf=${configDir} ${toString cfg.extraCmdLineOptions}"; + ExecStart = "${cfg.package}/bin/elasticsearch -Des.path.conf=${configDir} ${toString cfg.extraCmdLineOptions}"; User = "elasticsearch"; PermissionsStartOnly = true; }; @@ -142,7 +148,7 @@ in { ''; }; - environment.systemPackages = [ pkgs.elasticsearch ]; + environment.systemPackages = [ cfg.package ]; users.extraUsers = singleton { name = "elasticsearch";