nixos/prometheus: fix node exporter systemd collector

The systemd collector needs AF_UNIX to talk to
/var/run/dbus/system_bus_socket, which was broken
with 9fea6d4c85.

This commit allows AF_UNIX when needed.
This commit is contained in:
Matthias Treydte 2021-10-13 12:57:34 +02:00 committed by Profpatsch
parent b8ffa68b35
commit ae7ce180dd

View file

@ -35,6 +35,8 @@ in
${concatMapStringsSep " " (x: "--no-collector." + x) cfg.disabledCollectors} \
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} ${concatStringsSep " " cfg.extraFlags}
'';
# The systemd collector needs AF_UNIX
RestrictAddressFamilies = lib.optional (lib.any (x: x == "systemd") cfg.enabledCollectors) "AF_UNIX";
};
};
}