update: fixed issues and update flake inputs

This commit is contained in:
danny 2025-12-29 16:03:31 +08:00
parent 4b6183f0ec
commit b3c5ad2880
80 changed files with 3307 additions and 2059 deletions

View file

@ -7,7 +7,7 @@
}:
let
inherit (helper.grafana) mkDashboard;
inherit (lib) optionalAttrs;
inherit (lib) optionalAttrs optional;
inherit (config.networking) hostName;
datasourceTemplate = [
@ -78,28 +78,33 @@ in
}
];
})
(optionalAttrs config.services.crowdsec.settings.general.prometheus.enabled {
job_name = "crowdsec";
static_configs = [
{
targets = [
"localhost:${toString config.services.crowdsec.settings.general.prometheus.listen_port}"
];
labels = {
machine = "${hostName}";
};
}
];
relabel_configs = [
{
source_labels = [ "__address__" ];
target_label = "instance";
regex = "(.*):[0-9]+";
replacement = "CrowdSec - \${1}";
}
];
})
];
]
++ (optional
(config.services.crowdsec.enable && config.services.crowdsec.settings.general.prometheus.enabled)
[
{
job_name = "crowdsec";
static_configs = [
{
targets = [
"localhost:${toString config.services.crowdsec.settings.general.prometheus.listen_port}"
];
labels = {
machine = "${hostName}";
};
}
];
relabel_configs = [
{
source_labels = [ "__address__" ];
target_label = "instance";
regex = "(.*):[0-9]+";
replacement = "CrowdSec - \${1}";
}
];
}
]
);
})
(import ../../../modules/grafana.nix {