about summary refs log tree commit diff
path: root/nixos/modules/services/monitoring/prometheus/default.nix
diff options
context:
space:
mode:
authorShawn8901 <shawn8901@googlemail.com>2022-11-20 00:00:43 +0100
committerShawn8901 <shawn8901@googlemail.com>2022-12-15 10:14:42 +0100
commit6e530b9edaca212cca79f1e389f2c365886acbff (patch)
treed29a7f410e921fb140ffd2a163c9178b98107746 /nixos/modules/services/monitoring/prometheus/default.nix
parent470247d433ddcb527e18b556660c13f7632779b3 (diff)
downloadnixlib-6e530b9edaca212cca79f1e389f2c365886acbff.tar
nixlib-6e530b9edaca212cca79f1e389f2c365886acbff.tar.gz
nixlib-6e530b9edaca212cca79f1e389f2c365886acbff.tar.bz2
nixlib-6e530b9edaca212cca79f1e389f2c365886acbff.tar.lz
nixlib-6e530b9edaca212cca79f1e389f2c365886acbff.tar.xz
nixlib-6e530b9edaca212cca79f1e389f2c365886acbff.tar.zst
nixlib-6e530b9edaca212cca79f1e389f2c365886acbff.zip
prometheus: Adds an option for web.config.file which can specity settings including authorization.
Diffstat (limited to 'nixos/modules/services/monitoring/prometheus/default.nix')
-rw-r--r--nixos/modules/services/monitoring/prometheus/default.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix
index 86d186be54a5..f516b75ab10f 100644
--- a/nixos/modules/services/monitoring/prometheus/default.nix
+++ b/nixos/modules/services/monitoring/prometheus/default.nix
@@ -71,7 +71,8 @@ let
     "--web.listen-address=${cfg.listenAddress}:${builtins.toString cfg.port}"
     "--alertmanager.notification-queue-capacity=${toString cfg.alertmanagerNotificationQueueCapacity}"
   ] ++ optional (cfg.webExternalUrl != null) "--web.external-url=${cfg.webExternalUrl}"
-    ++ optional (cfg.retentionTime != null) "--storage.tsdb.retention.time=${cfg.retentionTime}";
+    ++ optional (cfg.retentionTime != null) "--storage.tsdb.retention.time=${cfg.retentionTime}"
+    ++ optional (cfg.webConfigFile != null) "--web.config.file=${cfg.webConfigFile}";
 
   filterValidPrometheus = filterAttrsListRecursive (n: v: !(n == "_module" || v == null));
   filterAttrsListRecursive = pred: x:
@@ -1717,6 +1718,15 @@ in
       '';
     };
 
+    webConfigFile = mkOption {
+      type = types.nullOr types.path;
+      default = null;
+      description = lib.mdDoc ''
+        Specifies which file should be used as web.config.file and be passed on startup.
+        See https://prometheus.io/docs/prometheus/latest/configuration/https/ for valid options.
+      '';
+    };
+
     checkConfig = mkOption {
       type = with types; either bool (enum [ "syntax-only" ]);
       default = true;