1{ lib, stdenvNoCC, makeWrapper, netcat, curl, unixtools, coreutils, mktemp
2, findutils, gnugrep, fetchFromGitHub, gawk, gnused }:
3
4stdenvNoCC.mkDerivation rec {
5 pname = "tinystatus";
6 version = "unstable-2021-07-09";
7
8 src = fetchFromGitHub {
9 owner = "bderenzo";
10 repo = "tinystatus";
11 rev = "fc128adf240261ac99ea3e3be8d65a92eda52a73";
12 sha256 = "sha256-FvQwibm6F10l9/U3RnNTGu+C2JjHOwbv62VxXAfI7/s=";
13 };
14
15 nativeBuildInputs = [ makeWrapper ];
16
17 runtimeInputs = [
18 curl
19 netcat
20 unixtools.ping
21 coreutils
22 mktemp
23 findutils
24 gnugrep
25 gawk
26 gnused
27 ];
28
29 installPhase = ''
30 runHook preInstall
31 install -Dm555 tinystatus $out/bin/tinystatus
32 wrapProgram $out/bin/tinystatus \
33 --set PATH "${lib.makeBinPath runtimeInputs}"
34 runHook postInstall
35 '';
36
37 doInstallCheck = true;
38
39 installCheckPhase = ''
40 runHook preCheck
41
42 cat <<EOF >test.csv
43 ping, 0, testing, this.should.fail.example.com
44 EOF
45
46 $out/bin/tinystatus test.csv | grep Disrupted
47
48 runHook postCheck
49 '';
50
51 meta = with lib; {
52 description = "A static HTML status page generator written in pure shell";
53 homepage = "https://github.com/bderenzo/tinystatus";
54 license = licenses.mit;
55 platforms = platforms.unix;
56 maintainers = with maintainers; [ matthewcroughan ];
57 };
58}