about summary refs log tree commit diff
path: root/nixos/modules/services/monitoring
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2024-03-06 14:35:24 +0100
committerGitHub <noreply@github.com>2024-03-06 14:35:24 +0100
commitf05e5f3a51d3891dc6430221fc06e2146b588767 (patch)
treed53cf35bd687880df0a72bbf4859c2539d6e2d28 /nixos/modules/services/monitoring
parent53ee1f579cce0fad221969fc948d89b732c9c319 (diff)
parentde306fb3d64f5086fbf63fec1d104f7187512b0d (diff)
downloadnixlib-f05e5f3a51d3891dc6430221fc06e2146b588767.tar
nixlib-f05e5f3a51d3891dc6430221fc06e2146b588767.tar.gz
nixlib-f05e5f3a51d3891dc6430221fc06e2146b588767.tar.bz2
nixlib-f05e5f3a51d3891dc6430221fc06e2146b588767.tar.lz
nixlib-f05e5f3a51d3891dc6430221fc06e2146b588767.tar.xz
nixlib-f05e5f3a51d3891dc6430221fc06e2146b588767.tar.zst
nixlib-f05e5f3a51d3891dc6430221fc06e2146b588767.zip
Merge pull request #285807 from MinerSebas/prometheus-restic-exporter
prometheus-restic-exporter: 1.4.0 -> 1.5.0
Diffstat (limited to 'nixos/modules/services/monitoring')
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters/restic.nix13
1 files changed, 7 insertions, 6 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/restic.nix b/nixos/modules/services/monitoring/prometheus/exporters/restic.nix
index 5b32c93a666d..977bd42e9812 100644
--- a/nixos/modules/services/monitoring/prometheus/exporters/restic.nix
+++ b/nixos/modules/services/monitoring/prometheus/exporters/restic.nix
@@ -93,12 +93,14 @@ in
   };
 
   serviceOpts = {
+    script = ''
+      export RESTIC_PASSWORD_FILE=$CREDENTIALS_DIRECTORY/RESTIC_PASSWORD_FILE
+      ${pkgs.prometheus-restic-exporter}/bin/restic-exporter.py \
+        ${concatStringsSep " \\\n  " cfg.extraFlags}
+    '';
     serviceConfig = {
-      ExecStart = ''
-        ${pkgs.prometheus-restic-exporter}/bin/restic-exporter.py \
-          ${concatStringsSep " \\\n  " cfg.extraFlags}
-      '';
       EnvironmentFile = mkIf (cfg.environmentFile != null) cfg.environmentFile;
+      LoadCredential = [ "RESTIC_PASSWORD_FILE:${cfg.passwordFile}" ];
     };
     environment =
       let
@@ -108,8 +110,7 @@ in
         toRcloneVal = v: if lib.isBool v then lib.boolToString v else v;
       in
       {
-        RESTIC_REPO_URL = cfg.repository;
-        RESTIC_REPO_PASSWORD_FILE = cfg.passwordFile;
+        RESTIC_REPOSITORY = cfg.repository;
         LISTEN_ADDRESS = cfg.listenAddress;
         LISTEN_PORT = toString cfg.port;
         REFRESH_INTERVAL = toString cfg.refreshInterval;