feat: add helper functions to filter probes in lib

This commit is contained in:
sinavir 2024-04-21 13:55:43 +02:00
parent 1c73542d29
commit 0ee4239e62

View file

@ -2,6 +2,18 @@
rec {
mkFqdn = _: cfg: cfg.networking.fqdn;
probesWithTag =
{
name,
value ? null,
}:
probesConfig:
lib.filterAttrs (
k: v: lib.any (tag: tag.name == name && (value == null || tag.value == value)) v.tags
) probesConfig.monitors;
probesWithType = type: probesConfig: lib.filterAttrs (_: v: v.type == type) probesConfig.monitors;
fromHive =
{
builder,