Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
64 lines
1.4 KiB
Nix
64 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
python3Packages,
|
|
prometheus-alertmanager,
|
|
runCommand,
|
|
prometheus-xmpp-alerts,
|
|
}:
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
pname = "prometheus-xmpp-alerts";
|
|
version = "0.6.0";
|
|
format = "pyproject";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "jelmer";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-kXcadJnPPhMKF/1CHMLdGCqWouAKDBFTdvPpn80yK4A=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace pyproject.toml \
|
|
--replace "bs4" "beautifulsoup4"
|
|
'';
|
|
|
|
propagatedBuildInputs = [
|
|
prometheus-alertmanager
|
|
]
|
|
++ (with python3Packages; [
|
|
aiohttp
|
|
aiohttp-openmetrics
|
|
beautifulsoup4
|
|
jinja2
|
|
slixmpp
|
|
prometheus-client
|
|
pyyaml
|
|
]);
|
|
|
|
nativeCheckInputs = with python3Packages; [
|
|
setuptools
|
|
unittestCheckHook
|
|
pytz
|
|
];
|
|
|
|
pythonImportsCheck = [ "prometheus_xmpp" ];
|
|
|
|
passthru.tests = {
|
|
binaryWorks = runCommand "${pname}-binary-test" { } ''
|
|
# Running with --help to avoid it erroring due to a missing config file
|
|
${prometheus-xmpp-alerts}/bin/prometheus-xmpp-alerts --help | tee $out
|
|
grep "usage: prometheus-xmpp-alerts" $out
|
|
'';
|
|
};
|
|
|
|
meta = {
|
|
description = "XMPP Web hook for Prometheus";
|
|
mainProgram = "prometheus-xmpp-alerts";
|
|
homepage = "https://github.com/jelmer/prometheus-xmpp-alerts";
|
|
maintainers = with lib.maintainers; [ fpletz ];
|
|
license = with lib.licenses; [ asl20 ];
|
|
};
|
|
}
|