mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
strip-ansi: init at 0.1.0-unstable-2024-09-01
This commit is contained in:
parent
c62f375656
commit
19e40fad1e
1 changed files with 46 additions and 0 deletions
46
pkgs/by-name/st/strip-ansi/package.nix
Normal file
46
pkgs/by-name/st/strip-ansi/package.nix
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
rustPlatform,
|
||||||
|
nix-update-script,
|
||||||
|
installShellFiles,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
canRunStripAnsi = stdenv.hostPlatform.emulatorAvailable buildPackages;
|
||||||
|
stripAnsiCompletions = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/strip-ansi-completions";
|
||||||
|
in
|
||||||
|
rustPlatform.buildRustPackage {
|
||||||
|
pname = "strip-ansi";
|
||||||
|
version = "0.1.0-unstable-2024-09-01";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "KSXGitHub";
|
||||||
|
repo = "strip-ansi-cli";
|
||||||
|
rev = "60dbdbc22b41f743c237cb75b11e72cf7884b792";
|
||||||
|
hash = "sha256-FvozEjNWXE1XEIq/06JehES7LVKoWmzIoaB4fD1kUsY=";
|
||||||
|
};
|
||||||
|
|
||||||
|
useFetchCargoVendor = true;
|
||||||
|
cargoHash = "sha256-kebx9OrAeh4c01VDUmlfTVn0EgFfzewiXjaQ3qtJrPY=";
|
||||||
|
|
||||||
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
|
postInstall = lib.optionalString canRunStripAnsi ''
|
||||||
|
installShellCompletion --cmd strip-ansi \
|
||||||
|
--bash <(${stripAnsiCompletions} bash) \
|
||||||
|
--fish <(${stripAnsiCompletions} fish) \
|
||||||
|
--zsh <(${stripAnsiCompletions} zsh)
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru.updateScript = nix-update-script { };
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
homepage = "https://github.com/KSXGitHub/strip-ansi-cli";
|
||||||
|
description = "Strip ANSI escape sequences from text";
|
||||||
|
license = [ lib.licenses.mit ];
|
||||||
|
maintainers = [ lib.maintainers._9999years ];
|
||||||
|
mainProgram = "strip-ansi";
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue