nixpkgs/pkgs/by-name/tl/tlrc/package.nix

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

40 lines
995 B
Nix
Raw Normal View History

2023-11-06 19:12:37 +00:00
{ lib
, fetchFromGitHub
, rustPlatform
, installShellFiles
}:
rustPlatform.buildRustPackage rec {
pname = "tlrc";
2023-11-30 20:04:25 +00:00
version = "1.8.0";
2023-11-06 19:12:37 +00:00
src = fetchFromGitHub {
owner = "tldr-pages";
repo = "tlrc";
rev = "v${version}";
2023-11-30 20:04:25 +00:00
hash = "sha256-wHAPlBNVhIytquEAUdrbxE4m0njVRPxxlYlwjqG9Zlw=";
2023-11-06 19:12:37 +00:00
};
2023-11-30 20:04:25 +00:00
cargoHash = "sha256-BymyjSVNwS3HPNnZcaAu1xUssV2iXmECtpKXPdZpM3g=";
2023-11-06 19:12:37 +00:00
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installManPage tldr.1
2023-11-30 20:04:25 +00:00
installShellCompletion --name tldr \
--bash $releaseDir/build/tlrc-*/out/tldr.bash \
2023-11-06 19:12:37 +00:00
--zsh $releaseDir/build/tlrc-*/out/_tldr \
--fish $releaseDir/build/tlrc-*/out/tldr.fish
'';
meta = with lib; {
description = "Official tldr client written in Rust";
homepage = "https://github.com/tldr-pages/tlrc";
changelog = "https://github.com/tldr-pages/tlrc/releases/tag/v${version}";
license = licenses.mit;
mainProgram = "tldr";
maintainers = with maintainers; [ acuteenvy ];
};
}