mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-02 07:31:26 +00:00
Add package option to elasticsearch NixOS module
This commit is contained in:
parent
1d5a96c3c6
commit
79c1bbf050
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user