From 418f49af7458fb8063a8ce004beaf9a032b14164 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sun, 29 Dec 2024 21:50:35 +0100 Subject: [PATCH] nixos/services.opensearch: remove `with lib;` --- nixos/modules/services/search/opensearch.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/nixos/modules/services/search/opensearch.nix b/nixos/modules/services/search/opensearch.nix index 59e04114eb69..6630dd017db6 100644 --- a/nixos/modules/services/search/opensearch.nix +++ b/nixos/modules/services/search/opensearch.nix @@ -4,9 +4,6 @@ pkgs, ... }: - -with lib; - let cfg = config.services.opensearch; @@ -28,7 +25,7 @@ in { options.services.opensearch = { - enable = mkEnableOption "OpenSearch"; + enable = lib.mkEnableOption "OpenSearch"; package = lib.mkPackageOption pkgs "OpenSearch" { default = [ "opensearch" ]; @@ -113,13 +110,13 @@ in rootLogger.level = info rootLogger.appenderRef.console.ref = console ''; - type = types.str; + type = lib.types.str; }; dataDir = lib.mkOption { type = lib.types.path; default = "/var/lib/opensearch"; - apply = converge (removeSuffix "/"); + apply = lib.converge (lib.removeSuffix "/"); description = '' Data directory for OpenSearch. If you change this, you need to manually create the directory. You also need to create the @@ -173,7 +170,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.opensearch = { description = "OpenSearch Daemon"; wantedBy = [ "multi-user.target" ]; @@ -194,7 +191,7 @@ in set -o errexit -o pipefail -o nounset -o errtrace shopt -s inherit_errexit '' - + (optionalString (!config.boot.isContainer) '' + + (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 @@ -268,7 +265,7 @@ in TimeoutStartSec = "infinity"; DynamicUser = usingDefaultUserAndGroup && usingDefaultDataDir; } - // (optionalAttrs (usingDefaultDataDir) { + // (lib.optionalAttrs (usingDefaultDataDir) { StateDirectory = "opensearch"; StateDirectoryMode = "0700"; });