about summary refs log tree commit diff
path: root/pkgs/by-name/tl/tlrc/package.nix
diff options
context:
space:
mode:
authorLena <126529524+acuteenvy@users.noreply.github.com>2023-11-06 20:12:37 +0100
committerLena <126529524+acuteenvy@users.noreply.github.com>2023-11-14 18:19:32 +0100
commit882f864a0ab5ffec9146c6ad35a9098e13f8d0f7 (patch)
tree5afa1feb3ae7ab639da264fb95fbfdbda46b33f2 /pkgs/by-name/tl/tlrc/package.nix
parentd1768cf54fd48e0abbbbf1b50d0ecec8b82e0243 (diff)
tlrc: init at 1.7.1
Diffstat (limited to 'pkgs/by-name/tl/tlrc/package.nix')
-rw-r--r--pkgs/by-name/tl/tlrc/package.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/by-name/tl/tlrc/package.nix b/pkgs/by-name/tl/tlrc/package.nix
new file mode 100644
index 0000000000000..e74ea6e558af6
--- /dev/null
+++ b/pkgs/by-name/tl/tlrc/package.nix
@@ -0,0 +1,39 @@
+{ lib
+, fetchFromGitHub
+, rustPlatform
+, installShellFiles
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "tlrc";
+  version = "1.7.1";
+
+  src = fetchFromGitHub {
+    owner = "tldr-pages";
+    repo = "tlrc";
+    rev = "v${version}";
+    hash = "sha256-Jdie9ESSbRV07SHjITfQPwDKTedHMbY01FdEMlNOr50=";
+  };
+
+  cargoHash = "sha256-2OXyPtgdRGIIc7jIES9zhRpFiaodcEnaK88k+rUVSJo=";
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  postInstall = ''
+    installManPage tldr.1
+
+    installShellCompletion \
+      --name tldr --bash $releaseDir/build/tlrc-*/out/tldr.bash \
+      --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 ];
+  };
+}