nixpkgs/pkgs/by-name/st/sttr/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.0 KiB
Nix
Raw Normal View History

2024-02-10 12:05:50 +00:00
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
pname = "sttr";
2024-03-24 14:19:26 +00:00
version = "0.2.19";
2024-02-10 12:05:50 +00:00
src = fetchFromGitHub {
owner = "abhimanyu003";
repo = "sttr";
rev = "v${version}";
2024-03-24 14:19:26 +00:00
hash = "sha256-OE7sp3K6a3XRc2yQTweoszacW8id/+/blND+4Bwlras=";
2024-02-10 12:05:50 +00:00
};
2024-03-24 14:19:26 +00:00
vendorHash = "sha256-Bkau3OKVwLBId8O/vc2XdjiPDSevoDcWICh2kLTCpz0=";
2024-02-10 12:05:50 +00:00
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";
};
}