diff options
author | Franz Pletz <fpletz@fnordicwalking.de> | 2024-03-06 14:35:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-06 14:35:24 +0100 |
commit | f05e5f3a51d3891dc6430221fc06e2146b588767 (patch) | |
tree | d53cf35bd687880df0a72bbf4859c2539d6e2d28 /nixos/modules/services/monitoring/prometheus | |
parent | 53ee1f579cce0fad221969fc948d89b732c9c319 (diff) | |
parent | de306fb3d64f5086fbf63fec1d104f7187512b0d (diff) |
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/prometheus')
-rw-r--r-- | nixos/modules/services/monitoring/prometheus/exporters/restic.nix | 13 |
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 5b32c93a666da..977bd42e9812e 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; |