4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{ lib, stdenv, fetchFromGitHub
|
|
, makeWrapper, installShellFiles
|
|
, python3, sqlite }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "tuptime";
|
|
version = "5.0.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "rfrail3";
|
|
repo = "tuptime";
|
|
rev = version;
|
|
sha256 = "0nk3yyjavgmc435vj3f0siw4y5nwipsbcsvsf5m7mgvq0xi8f3ls";
|
|
};
|
|
|
|
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 lib; {
|
|
description = "Total uptime & downtime statistics utility";
|
|
homepage = "https://github.com/rfrail3/tuptime";
|
|
license = licenses.gpl2Plus;
|
|
platforms = platforms.all;
|
|
maintainers = [ maintainers.evils ];
|
|
};
|
|
}
|