17 inherit (utils) escapeSystemdExecArgs;
19 cfg = config.services.prometheus.exporters.fastly;
23 extraOpts = with types; {
24 configFile = mkOption {
27 example = "./fastly-exporter-config.txt";
29 Path to a fastly-exporter configuration file.
30 Example one can be generated with `fastly-exporter --config-file-example`.
34 tokenPath = mkOption {
37 A run-time path to the token file, which is supposed to be provisioned
44 LoadCredential = "fastly-api-token:${cfg.tokenPath}";
45 Environment = [ "FASTLY_API_TOKEN=%d/fastly-api-token" ];
46 ExecStart = escapeSystemdExecArgs (
48 (getExe pkgs.prometheus-fastly-exporter)
50 "${cfg.listenAddress}:${toString cfg.port}"
52 ++ optionals (cfg.configFile != null) [