frigate: fix event preview (#372427)
[NixPkgs.git] / pkgs / by-name / st / sttr / package.nix
blobfa864df910bca866b166db93c330ae758e89fe35
2   lib,
3   buildGoModule,
4   fetchFromGitHub,
5   installShellFiles,
6 }:
8 buildGoModule rec {
9   pname = "sttr";
10   version = "0.2.24";
12   src = fetchFromGitHub {
13     owner = "abhimanyu003";
14     repo = "sttr";
15     rev = "v${version}";
16     hash = "sha256-9p4h30iM3SZDCAn08KQjJLJGbQND13gbWK5rhW+Knok=";
17   };
19   vendorHash = "sha256-GJtnwnT+dJAjnAlGcoealsiKcLu0bBBHOE8xRjJQaVs=";
21   nativeBuildInputs = [ installShellFiles ];
23   ldflags = [
24     "-s"
25     "-w"
26     "-X=main.version=${version}"
27   ];
29   postInstall = ''
30     installShellCompletion --cmd sttr \
31       --bash <($out/bin/sttr completion bash) \
32       --fish <($out/bin/sttr completion fish) \
33       --zsh <($out/bin/sttr completion zsh)
34   '';
36   meta = with lib; {
37     description = "Cross-platform cli tool to perform various operations on string";
38     homepage = "https://github.com/abhimanyu003/sttr";
39     changelog = "https://github.com/abhimanyu003/sttr/releases/tag/v${version}";
40     license = licenses.mit;
41     maintainers = with maintainers; [ Ligthiago ];
42     mainProgram = "sttr";
43   };