about summary refs log tree commit diff
path: root/pkgs/tools/admin/ssl-cert-check/default.nix
blob: 857fc096e06d38f4b17e74fb12363169d81b6a80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ lib
, stdenv
, coreutils
, fetchFromGitHub
, findutils
, gawk
, gnugrep
, gnused
, makeWrapper
, mktemp
, openssl
, which
}:

stdenv.mkDerivation rec {
  pname = "ssl-cert-check";
  version = "4.14";

  src = fetchFromGitHub {
    owner = "Matty9191";
    repo = pname;
    rev = "4056ceeab5abc0e39f4e0ea40cd54147253a3369";
    sha256 = "07k2n4l68hykraxvy030djc208z8rqff3kc7wy4ib9g6qj7s4mif";
  };

  nativeBuildInputs = [
    makeWrapper
  ];

  buildInputs = [
    coreutils
    findutils
    gawk
    gnugrep
    gnused
    mktemp
    openssl
    which
  ];

  prePatch = ''
    substituteInPlace $pname --replace PATH= NOT_PATH=
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp $pname $out/bin/$pname
    wrapProgram $out/bin/$pname \
      --set PATH "${lib.makeBinPath buildInputs}"
  '';

  meta = with lib; {
    description = "Bourne shell script that can be used to report on expiring SSL certificates";
    mainProgram = "ssl-cert-check";
    homepage = "https://github.com/Matty9191/ssl-cert-check";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ ryantm ];
    platforms = platforms.linux;
  };
}