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