mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
Merge pull request #9880 from mbbx6spp/add-package-option-elasticsearch-module
elasticsearch module: add package option
This commit is contained in:
commit
122efd93d0
@ -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