nixpkgs/pkgs/tools/misc/tldr/default.nix

38 lines
1.1 KiB
Nix

{ lib, stdenv, fetchFromGitHub, curl, libzip, pkg-config, installShellFiles }:
stdenv.mkDerivation rec {
pname = "tldr";
version = "1.6.0";
src = fetchFromGitHub {
owner = "tldr-pages";
repo = "tldr-cpp-client";
rev = "v${version}";
sha256 = "2cd16cd956d15b1d33d7a5e2a2566500ab5766d2fa1b9ee7e49e64acc0352785";
};
buildInputs = [ curl libzip ];
nativeBuildInputs = [ pkg-config installShellFiles ];
makeFlags = ["CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc" "CFLAGS="];
installFlags = [ "PREFIX=$(out)" ];
postInstall = ''
installShellCompletion --cmd tldr autocomplete/complete.{bash,fish,zsh}
'';
meta = with lib; {
description = "Simplified and community-driven man pages";
longDescription = ''
tldr pages gives common use cases for commands, so you don't need to hunt
through a man page for the correct flags.
'';
homepage = "https://tldr.sh";
changelog = "https://github.com/tldr-pages/tldr-c-client/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ taeer carlosdagos kbdharun];
platforms = platforms.all;
};
}