9 cfg = config.services.prometheus.exporters.deluge;
10 inherit (lib) mkOption types concatStringsSep;
16 delugeHost = mkOption {
18 default = "localhost";
20 Hostname where deluge server is running.
24 delugePort = mkOption {
28 Port where deluge server is listening.
32 delugeUser = mkOption {
34 default = "localclient";
36 User to connect to deluge server.
40 delugePassword = mkOption {
41 type = types.nullOr types.str;
44 Password to connect to deluge server.
46 This stores the password unencrypted in the nix store and is thus considered unsafe. Prefer
47 using the delugePasswordFile option.
51 delugePasswordFile = mkOption {
52 type = types.nullOr types.path;
55 File containing the password to connect to deluge server.
59 exportPerTorrentMetrics = mkOption {
63 Enable per-torrent metrics.
65 This may significantly increase the number of time series depending on the number of
66 torrents in your Deluge instance.
73 ${pkgs.prometheus-deluge-exporter}/bin/deluge-exporter
77 "LISTEN_PORT=${toString cfg.port}"
78 "LISTEN_ADDRESS=${toString cfg.listenAddress}"
80 "DELUGE_HOST=${cfg.delugeHost}"
81 "DELUGE_USER=${cfg.delugeUser}"
82 "DELUGE_PORT=${toString cfg.delugePort}"
84 ++ lib.optionals (cfg.delugePassword != null) [
85 "DELUGE_PASSWORD=${cfg.delugePassword}"
87 ++ lib.optionals cfg.exportPerTorrentMetrics [
88 "PER_TORRENT_METRICS=1"
90 EnvironmentFile = lib.optionalString (
91 cfg.delugePasswordFile != null
92 ) "/etc/deluge-exporter/password";