···
cfg = config.services.opensearch;
···
options.services.opensearch = {
31
-
enable = mkEnableOption "OpenSearch";
28
+
enable = lib.mkEnableOption "OpenSearch";
package = lib.mkPackageOption pkgs "OpenSearch" {
default = [ "opensearch" ];
···
rootLogger.appenderRef.console.ref = console
113
+
type = lib.types.str;
default = "/var/lib/opensearch";
122
-
apply = converge (removeSuffix "/");
119
+
apply = lib.converge (lib.removeSuffix "/");
Data directory for OpenSearch. If you change this, you need to
manually create the directory. You also need to create the
···
176
-
config = mkIf cfg.enable {
173
+
config = lib.mkIf cfg.enable {
systemd.services.opensearch = {
description = "OpenSearch Daemon";
wantedBy = [ "multi-user.target" ];
···
set -o errexit -o pipefail -o nounset -o errtrace
197
-
+ (optionalString (!config.boot.isContainer) ''
194
+
+ (lib.optionalString (!config.boot.isContainer) ''
# Only set vm.max_map_count if lower than ES required minimum
# This avoids conflict if configured via boot.kernel.sysctl
if [ $(${pkgs.procps}/bin/sysctl -n vm.max_map_count) -lt 262144 ]; then
···
TimeoutStartSec = "infinity";
DynamicUser = usingDefaultUserAndGroup && usingDefaultDataDir;
271
-
// (optionalAttrs (usingDefaultDataDir) {
268
+
// (lib.optionalAttrs (usingDefaultDataDir) {
StateDirectory = "opensearch";
StateDirectoryMode = "0700";