1 { config, lib, pkgs, ... }:
4 cfg = config.services.prometheus.exporters.deluge;
5 inherit (lib) mkOption types concatStringsSep;
11 delugeHost = mkOption {
13 default = "localhost";
15 Hostname where deluge server is running.
19 delugePort = mkOption {
23 Port where deluge server is listening.
27 delugeUser = mkOption {
29 default = "localclient";
31 User to connect to deluge server.
35 delugePassword = mkOption {
36 type = types.nullOr types.str;
39 Password to connect to deluge server.
41 This stores the password unencrypted in the nix store and is thus considered unsafe. Prefer
42 using the delugePasswordFile option.
46 delugePasswordFile = mkOption {
47 type = types.nullOr types.path;
50 File containing the password to connect to deluge server.
54 exportPerTorrentMetrics = mkOption {
58 Enable per-torrent metrics.
60 This may significantly increase the number of time series depending on the number of
61 torrents in your Deluge instance.
68 ${pkgs.prometheus-deluge-exporter}/bin/deluge-exporter
71 "LISTEN_PORT=${toString cfg.port}"
72 "LISTEN_ADDRESS=${toString cfg.listenAddress}"
74 "DELUGE_HOST=${cfg.delugeHost}"
75 "DELUGE_USER=${cfg.delugeUser}"
76 "DELUGE_PORT=${toString cfg.delugePort}"
77 ] ++ lib.optionals (cfg.delugePassword != null) [
78 "DELUGE_PASSWORD=${cfg.delugePassword}"
79 ] ++ lib.optionals cfg.exportPerTorrentMetrics [
80 "PER_TORRENT_METRICS=1"
82 EnvironmentFile = lib.optionalString (cfg.delugePasswordFile != null) "/etc/deluge-exporter/password";