1 { fetchFromGitHub, python3Packages, lib }:
3 python3Packages.buildPythonApplication rec {
4 pname = "check_systemd";
7 src = fetchFromGitHub {
8 owner = "Josef-Friedrich";
11 sha256 = "11sc0gycxzq1vfvin501jnwnky2ky6ns64yjiw8vq9vmkbf8nni6";
14 propagatedBuildInputs = with python3Packages; [ nagiosplugin ];
17 # check_systemd is only a broken stub calling check_systemd.py
18 mv $out/bin/check_systemd{.py,}
21 # the test scripts run ./check_systemd.py and check_systemd. Patch to
22 # the installed, patchShebanged executable in $out/bin
24 find test -name "*.py" -execdir sed -i "s@./check_systemd.py@$out/bin/check_systemd@" '{}' ";"
25 export PATH=$PATH:$out/bin
27 nativeCheckInputs = [ python3Packages.pytestCheckHook ];
30 description = "Nagios / Icinga monitoring plugin to check systemd for failed units";
31 mainProgram = "check_systemd";
32 inherit (src.meta) homepage;
33 changelog = "https://github.com/Josef-Friedrich/check_systemd/releases";
34 maintainers = with maintainers; [ symphorien ];
35 license = licenses.lgpl2Only;
36 platforms = platforms.linux;