depot/pkgs/servers/monitoring/nagios-plugins/check_systemd/default.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

50 lines
1.2 KiB
Nix

{
fetchFromGitHub,
lib,
python3Packages,
}:
python3Packages.buildPythonApplication rec {
pname = "check-systemd";
version = "4.1.0";
pyproject = true;
src = fetchFromGitHub {
owner = "Josef-Friedrich";
repo = "check_systemd";
rev = "refs/tags/v${version}";
hash = "sha256-1e1WtWRTmOxozuOP2ndfsozuiy9LCT/Lsvb+yKH+8eY=";
};
postPatch = ''
substituteInPlace tests/test_argparse.py \
--replace-fail "./check_systemd.py" "check_systemd"
'';
build-system = with python3Packages; [
poetry-core
];
dependencies = with python3Packages; [
nagiosplugin
];
# needs to be able to run check_systemd from PATH
preCheck = ''
export PATH=$PATH:$out/bin
'';
nativeCheckInputs = with python3Packages; [
pytestCheckHook
];
meta = {
changelog = "https://github.com/Josef-Friedrich/check_systemd/releases";
description = "Nagios / Icinga monitoring plugin to check systemd for failed units";
homepage = "https://github.com/Josef-Friedrich/check_systemd";
license = lib.licenses.lgpl2Only;
mainProgram = "check_systemd";
maintainers = with lib.maintainers; [ symphorien ];
platforms = lib.platforms.linux;
};
}