depot/third_party/nixpkgs/pkgs/by-name/st/sttr/package.nix
Default email 98eb3e9ef5 Project import generated by Copybara.
GitOrigin-RevId: 00d80d13810dbfea8ab4ed1009b09100cca86ba8
2024-07-01 15:47:52 +00:00

43 lines
1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
pname = "sttr";
version = "0.2.22";
src = fetchFromGitHub {
owner = "abhimanyu003";
repo = "sttr";
rev = "v${version}";
hash = "sha256-VEfMkUMrn9yKMg1M56uFhM8ego3EyY1MqEgzkZE6Zbk=";
};
vendorHash = "sha256-L3XKjJSk/1Evzq4ieUsJ4ewyfS8NDDSd10aDdsc5IcI=";
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X=main.version=${version}"
];
postInstall = ''
installShellCompletion --cmd sttr \
--bash <($out/bin/sttr completion bash) \
--fish <($out/bin/sttr completion fish) \
--zsh <($out/bin/sttr completion zsh)
'';
meta = with lib; {
description = "Cross-platform cli tool to perform various operations on string";
homepage = "https://github.com/abhimanyu003/sttr";
changelog = "https://github.com/abhimanyu003/sttr/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ Ligthiago ];
mainProgram = "sttr";
};
}