2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2020-05-31 02:11:23 +00:00
|
|
|
, makeWrapper, installShellFiles
|
2022-01-22 06:29:19 +00:00
|
|
|
, python3, sqlite
|
|
|
|
, nixosTests
|
|
|
|
}:
|
2020-03-24 22:21:03 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tuptime";
|
2023-01-07 16:40:20 +00:00
|
|
|
version = "5.2.2";
|
2020-03-24 22:21:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-01-07 16:40:20 +00:00
|
|
|
owner = "rfmoz";
|
2020-03-24 22:21:03 +00:00
|
|
|
repo = "tuptime";
|
|
|
|
rev = version;
|
2023-01-07 16:40:20 +00:00
|
|
|
sha256 = "sha256-YrZP2sovAwwfDBoKoobgkf0+7RmYFUtrV9jfBmDsNL8=";
|
2020-03-24 22:21:03 +00:00
|
|
|
};
|
|
|
|
|
2020-05-31 02:11:23 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
|
|
|
|
2020-03-24 22:21:03 +00:00
|
|
|
buildInputs = [ python3 ];
|
|
|
|
|
2020-05-31 02:11:23 +00:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2020-03-24 22:21:03 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
2020-05-31 02:11:23 +00:00
|
|
|
install -m 755 $src/src/tuptime $out/bin/
|
2020-03-24 22:21:03 +00:00
|
|
|
|
2020-05-31 02:11:23 +00:00
|
|
|
installManPage $src/src/man/tuptime.1
|
|
|
|
|
|
|
|
install -Dm 0755 $src/misc/scripts/db-tuptime-migrate-4.0-to-5.0.sh \
|
|
|
|
$out/share/tuptime/db-tuptime-migrate-4.0-to-5.0.sh
|
|
|
|
'';
|
2020-03-24 22:21:03 +00:00
|
|
|
|
2020-05-31 02:11:23 +00:00
|
|
|
preFixup = ''
|
|
|
|
wrapProgram $out/share/tuptime/db-tuptime-migrate-4.0-to-5.0.sh \
|
2021-01-15 09:19:50 +00:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ sqlite ]}"
|
2020-03-24 22:21:03 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-22 06:29:19 +00:00
|
|
|
passthru.tests = nixosTests.tuptime;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-03-24 22:21:03 +00:00
|
|
|
description = "Total uptime & downtime statistics utility";
|
|
|
|
homepage = "https://github.com/rfrail3/tuptime";
|
2022-08-16 07:55:31 +00:00
|
|
|
changelog = "https://github.com/rfrail3/tuptime/blob/master/CHANGELOG";
|
2020-06-23 10:49:01 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-03-24 22:21:03 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ maintainers.evils ];
|
|
|
|
};
|
|
|
|
}
|