3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/system/tuptime/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub
, makeWrapper, installShellFiles
, python3, sqlite
, nixosTests
}:
2020-03-24 22:21:03 +00:00
stdenv.mkDerivation rec {
pname = "tuptime";
2022-08-24 02:52:56 +01:00
version = "5.2.1";
2020-03-24 22:21:03 +00:00
src = fetchFromGitHub {
owner = "rfrail3";
repo = "tuptime";
rev = version;
2022-08-24 02:52:56 +01:00
sha256 = "sha256-C5Wg3z1PGqgUfdjsSKcI9lvR0a6NcJfsZd+wMl0Fz+U=";
2020-03-24 22:21:03 +00:00
};
nativeBuildInputs = [ makeWrapper installShellFiles ];
2020-03-24 22:21:03 +00:00
buildInputs = [ python3 ];
outputs = [ "out" "man" ];
2020-03-24 22:21:03 +00:00
installPhase = ''
mkdir -p $out/bin
install -m 755 $src/src/tuptime $out/bin/
2020-03-24 22:21:03 +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
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
'';
passthru.tests = nixosTests.tuptime;
meta = with lib; {
2020-03-24 22:21:03 +00:00
description = "Total uptime & downtime statistics utility";
homepage = "https://github.com/rfrail3/tuptime";
changelog = "https://github.com/rfrail3/tuptime/blob/master/CHANGELOG";
license = licenses.gpl2Plus;
2020-03-24 22:21:03 +00:00
platforms = platforms.all;
maintainers = [ maintainers.evils ];
};
}