3
0
Fork 0
forked from mirrors/nixpkgs

elasticsearch: remove logic for version less than 6

This commit is contained in:
happysalada 2021-08-31 12:43:28 +09:00 committed by Raphael Megzari
parent d58fa9e445
commit 4ddc5c6b2a

View file

@ -5,8 +5,6 @@ with lib;
let
cfg = config.services.elasticsearch;
es6 = builtins.compareVersions cfg.package.version "6" >= 0;
esConfig = ''
network.host: ${cfg.listenAddress}
cluster.name: ${cfg.cluster_name}
@ -147,9 +145,7 @@ in
path = [ pkgs.inetutils ];
environment = {
ES_HOME = cfg.dataDir;
ES_JAVA_OPTS = toString (optional (!es6) [ "-Des.path.conf=${configDir}" ]
++ cfg.extraJavaOptions);
} // optionalAttrs es6 {
ES_JAVA_OPTS = toString cfg.extraJavaOptions;
ES_PATH_CONF = configDir;
};
serviceConfig = {
@ -188,7 +184,7 @@ in
rm -f "${configDir}/logging.yml"
cp ${loggingConfigFile} ${configDir}/${loggingConfigFilename}
mkdir -p ${configDir}/scripts
${optionalString es6 "cp ${cfg.package}/config/jvm.options ${configDir}/jvm.options"}
cp ${cfg.package}/config/jvm.options ${configDir}/jvm.options
# redirect jvm logs to the data directory
mkdir -m 0700 -p ${cfg.dataDir}/logs
${pkgs.sd}/bin/sd 'logs/gc.log' '${cfg.dataDir}/logs/gc.log' ${configDir}/jvm.options \