2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, Security
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "tealdeer";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "1.7.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dbrgn";
|
|
|
|
repo = "tealdeer";
|
|
|
|
rev = "v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-7Wavhl5irQU9OV7+dslrIQEAcsaqJZ/jWmxaCyTBsEs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
cargoHash = "sha256-WCbpwvCXm54/Cv+TscaqseWzTUd8V1DxmS30fUZZTwI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optional stdenv.hostPlatform.isDarwin Security;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-06-16 17:23:12 +00:00
|
|
|
installShellCompletion --cmd tldr \
|
2022-10-06 18:32:54 +00:00
|
|
|
--bash completion/bash_tealdeer \
|
|
|
|
--fish completion/fish_tealdeer \
|
|
|
|
--zsh completion/zsh_tealdeer
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
# Disable tests that require Internet access:
|
|
|
|
checkFlags = [
|
|
|
|
"--skip test_autoupdate_cache"
|
|
|
|
"--skip test_create_cache_directory_path"
|
|
|
|
"--skip test_pager_flag_enable"
|
|
|
|
"--skip test_quiet_cache"
|
|
|
|
"--skip test_quiet_failures"
|
|
|
|
"--skip test_quiet_old_cache"
|
|
|
|
"--skip test_spaces_find_command"
|
|
|
|
"--skip test_update_cache"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Very fast implementation of tldr in Rust";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/dbrgn/tealdeer";
|
2024-10-04 16:56:33 +00:00
|
|
|
maintainers = with maintainers; [ davidak newam mfrw ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = with licenses; [ asl20 mit ];
|
2021-09-18 10:52:07 +00:00
|
|
|
mainProgram = "tldr";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|