nixos/prometheus-restic-exporter: set cache dir (#378228)

* nixos/prometheus-restic-exporter: set cache dir

* prometheus-restic-exporter: use systemd variable for cachedir

Anton Tetov 494b2407 b4ea290d

Changed files
+2
nixos
modules
services
monitoring
prometheus
exporters
+2
nixos/modules/services/monitoring/prometheus/exporters/restic.nix
···
${concatStringsSep " \\\n " cfg.extraFlags}
'';
serviceConfig = {
EnvironmentFile = mkIf (cfg.environmentFile != null) cfg.environmentFile;
LoadCredential = [
"RESTIC_PASSWORD_FILE:${cfg.passwordFile}"
···
LISTEN_ADDRESS = cfg.listenAddress;
LISTEN_PORT = toString cfg.port;
REFRESH_INTERVAL = toString cfg.refreshInterval;
}
// (mapAttrs' (
name: value: nameValuePair (rcloneAttrToOpt name) (toRcloneVal value)
···
${concatStringsSep " \\\n " cfg.extraFlags}
'';
serviceConfig = {
+
CacheDirectory = "restic-exporter";
EnvironmentFile = mkIf (cfg.environmentFile != null) cfg.environmentFile;
LoadCredential = [
"RESTIC_PASSWORD_FILE:${cfg.passwordFile}"
···
LISTEN_ADDRESS = cfg.listenAddress;
LISTEN_PORT = toString cfg.port;
REFRESH_INTERVAL = toString cfg.refreshInterval;
+
RESTIC_CACHE_DIR = "$CACHE_DIRECTORY";
}
// (mapAttrs' (
name: value: nameValuePair (rcloneAttrToOpt name) (toRcloneVal value)