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