about summary refs log tree commit diff
path: root/pkgs/by-name/li
diff options
context:
space:
mode:
authorAleksana <me@aleksana.moe>2024-04-06 00:21:31 +0800
committerGitHub <noreply@github.com>2024-04-06 00:21:31 +0800
commit430c29bff4179472a3d9dcc48ac2917f074e8a9d (patch)
tree16de5e091f516eec657c3bc1f10cdc5dff00b378 /pkgs/by-name/li
parent0b7ea8db6cab824666730e470c02d0a5556e862f (diff)
parentf92f91aa0b668d191c0786cf393281a0c22a8048 (diff)
Merge pull request #296973 from giodamelio/init_little_boxes
little_boxes: init at 1.10.0
Diffstat (limited to 'pkgs/by-name/li')
-rw-r--r--pkgs/by-name/li/little_boxes/package.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/by-name/li/little_boxes/package.nix b/pkgs/by-name/li/little_boxes/package.nix
new file mode 100644
index 0000000000000..ebc2da2e404ec
--- /dev/null
+++ b/pkgs/by-name/li/little_boxes/package.nix
@@ -0,0 +1,57 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, installShellFiles
+, testers
+, little_boxes
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "little_boxes";
+  version = "1.10.0";
+
+  src = fetchFromGitHub {
+    owner = "giodamelio";
+    repo = "little_boxes";
+    rev = version;
+    hash = "sha256-Quh09K5meiA39ih/orJWF2WfkuZdymxub1dZvns/q3E=";
+  };
+
+  cargoVendorDir = "vendor";
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  postInstall = ''
+    extrasPath=$(ls -d $releaseDir/build/little_boxes-*/out/)
+
+    installManPage $extrasPath/little_boxes.1
+    installShellCompletion --bash $extrasPath/little_boxes.bash
+    installShellCompletion --fish $extrasPath/little_boxes.fish
+    installShellCompletion --zsh $extrasPath/_little_boxes
+  '';
+
+  passthru.tests.version = testers.testVersion {
+    package = little_boxes;
+    command = "little_boxes --version";
+  };
+
+  meta = with lib; {
+    description = "Add boxes are input text";
+    longDescription = ''
+      little_boxes is a small program that takes input from stdin or a file
+      and wraps it with box made of ACII/Unicode Box Drawing characters. There
+      are several different charsets and you can optionally add a title
+
+      Example:
+
+      $ echo "Hello World" | little_boxes
+      ┏━━━━━━━━━━━━━┓
+      ┃ Hello World ┃
+      ┗━━━━━━━━━━━━━┛
+    '';
+    homepage = "https://github.com/giodamelio/little_boxes";
+    license = licenses.mit;
+    maintainers = with maintainers; [ giodamelio ];
+    mainProgram = "little_boxes";
+  };
+}