depot/third_party/nixpkgs/pkgs/tools/system/tuptime/default.nix
Default email 2ce89355c3 Project import generated by Copybara.
GitOrigin-RevId: 22a81aa5fc15b2d41b12f7160a71cd4a9f3c3fa1
2020-06-15 17:56:04 +02:00

44 lines
1.1 KiB
Nix

{ stdenv, fetchFromGitHub
, makeWrapper, installShellFiles
, python3, sqlite }:
stdenv.mkDerivation rec {
pname = "tuptime";
version = "5.0.0";
src = fetchFromGitHub {
owner = "rfrail3";
repo = "tuptime";
rev = version;
sha256 = "0izps85p8pxidfrzp7l4hp221fx3dcgapapsix1zavq6jrsl2qyh";
};
nativeBuildInputs = [ makeWrapper installShellFiles ];
buildInputs = [ python3 ];
outputs = [ "out" "man" ];
installPhase = ''
mkdir -p $out/bin
install -m 755 $src/src/tuptime $out/bin/
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
'';
preFixup = ''
wrapProgram $out/share/tuptime/db-tuptime-migrate-4.0-to-5.0.sh \
--prefix PATH : "${stdenv.lib.makeBinPath [ sqlite ]}"
'';
meta = with stdenv.lib; {
description = "Total uptime & downtime statistics utility";
homepage = "https://github.com/rfrail3/tuptime";
license = licenses.gpl2;
platforms = platforms.all;
maintainers = [ maintainers.evils ];
};
}