From e7e4e0c3b6b01e905f7411b793d5909720a93cf9 Mon Sep 17 00:00:00 2001 From: Joerg Thalheim Date: Sun, 8 Oct 2017 15:05:25 +0100 Subject: [PATCH] nixos/prometheus-minio-exporter: only inherit keys from minio if set --- .../monitoring/prometheus/minio-exporter.nix | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/monitoring/prometheus/minio-exporter.nix b/nixos/modules/services/monitoring/prometheus/minio-exporter.nix index bc3967f8612..4314671523c 100644 --- a/nixos/modules/services/monitoring/prometheus/minio-exporter.nix +++ b/nixos/modules/services/monitoring/prometheus/minio-exporter.nix @@ -37,26 +37,30 @@ in { ''; }; - minioAccessKey = mkOption { + minioAccessKey = mkOption ({ type = types.str; example = "BKIKJAA5BMMU2RHO6IBB"; - default = if config.services.minio.enable then config.services.minio.accessKey else null; description = '' The value of the Minio access key. It is required in order to connect to the server. - By default this uses the one from the local minio server if enabled. + By default this uses the one from the local minio server if enabled + and config.services.minio.accessKey. ''; - }; + } // optionalAttrs (config.services.minio.enable && config.services.minio.accessKey != "") { + default = config.services.minio.accessKey; + }); - minioAccessSecret = mkOption { + minioAccessSecret = mkOption ({ type = types.str; - default = if config.services.minio.enable then config.services.minio.secretKey else null; description = '' The calue of the Minio access secret. It is required in order to connect to the server. - By default this uses the one from the local minio server if enabled. + By default this uses the one from the local minio server if enabled + and config.services.minio.secretKey. ''; - }; + } // optionalAttrs (config.services.minio.enable && config.services.minio.secretKey != "") { + default = config.services.minio.secretKey; + }); minioBucketStats = mkOption { type = types.bool;