1{ config, pkgs, lib, ... }:
2
3with lib;
4
5let cfg = config.services.prometheus.exporters.systemd;
6
7in {
8 port = 9558;
9
10 serviceOpts = {
11 serviceConfig = {
12 ExecStart = ''
13 ${pkgs.prometheus-systemd-exporter}/bin/systemd_exporter \
14 --web.listen-address ${cfg.listenAddress}:${toString cfg.port} ${concatStringsSep " " cfg.extraFlags}
15 '';
16 RestrictAddressFamilies = [
17 # Need AF_UNIX to collect data
18 "AF_UNIX"
19 ];
20 };
21 };
22}