mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-30 21:15:21 +03:00

Fixes issues described in #208242 for this part of the nixpkgs tree. There are no behavioral changes in this, it only adjusts the code so that it is easier to understand.
19 lines
472 B
Nix
19 lines
472 B
Nix
{ config, lib, pkgs, options, ... }:
|
|
|
|
let
|
|
cfg = config.services.prometheus.exporters.redis;
|
|
inherit (lib) concatStringsSep;
|
|
in
|
|
{
|
|
port = 9121;
|
|
serviceOpts = {
|
|
serviceConfig = {
|
|
RestrictAddressFamilies = [ "AF_UNIX" ];
|
|
ExecStart = ''
|
|
${pkgs.prometheus-redis-exporter}/bin/redis_exporter \
|
|
-web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
|
${concatStringsSep " \\\n " cfg.extraFlags}
|
|
'';
|
|
};
|
|
};
|
|
}
|