lol
1{ lib
2, stdenv
3, bc
4, bind # host and dig binary
5, coreutils # date and timeout binary
6, curl
7, fetchFromGitHub
8, file
9, iproute2
10, makeWrapper
11, netcat-gnu
12, nmap
13, openssl
14, python3
15, which
16}:
17
18stdenv.mkDerivation rec {
19 pname = "check_ssl_cert";
20 version = "2.76.0";
21
22 src = fetchFromGitHub {
23 owner = "matteocorti";
24 repo = "check_ssl_cert";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-nk+uYO8tJPUezu/nqfwNhK4q/ds9C96re/fWebrTa1Y=";
27 };
28
29 nativeBuildInputs = [
30 makeWrapper
31 ];
32
33 makeFlags = [
34 "DESTDIR=$(out)/bin"
35 "MANDIR=$(out)/share/man"
36 ];
37
38 postInstall = ''
39 wrapProgram $out/bin/check_ssl_cert \
40 --prefix PATH : "${lib.makeBinPath ([ openssl file which curl bc coreutils bind nmap netcat-gnu python3 ] ++ lib.optional stdenv.isLinux iproute2) }"
41 '';
42
43 meta = with lib; {
44 description = "Nagios plugin to check the CA and validity of an X.509 certificate";
45 homepage = "https://github.com/matteocorti/check_ssl_cert";
46 changelog = "https://github.com/matteocorti/check_ssl_cert/releases/tag/v${version}";
47 license = licenses.gpl3Plus;
48 maintainers = with maintainers; [ fab ];
49 platforms = platforms.all;
50 };
51}