Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
43 lines
1 KiB
Nix
43 lines
1 KiB
Nix
{ lib
|
|
, buildGoModule
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "sttr";
|
|
version = "0.2.24";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "abhimanyu003";
|
|
repo = "sttr";
|
|
rev = "v${version}";
|
|
hash = "sha256-9p4h30iM3SZDCAn08KQjJLJGbQND13gbWK5rhW+Knok=";
|
|
};
|
|
|
|
vendorHash = "sha256-GJtnwnT+dJAjnAlGcoealsiKcLu0bBBHOE8xRjJQaVs=";
|
|
|
|
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";
|
|
};
|
|
}
|