nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 44 lines 1.0 kB view raw
1{ 2 lib, 3 buildGoModule, 4 fetchFromGitHub, 5 installShellFiles, 6}: 7 8buildGoModule rec { 9 pname = "sttr"; 10 version = "0.2.26"; 11 12 src = fetchFromGitHub { 13 owner = "abhimanyu003"; 14 repo = "sttr"; 15 rev = "v${version}"; 16 hash = "sha256-VyO4NyiTWWQJjbhKHoIC86B4KdSowlrR6XR3HCKr0U4="; 17 }; 18 19 vendorHash = "sha256-g35BCThoym9awjMObMUecRkkLsQyEIviYc4rdQsIICY="; 20 21 nativeBuildInputs = [ installShellFiles ]; 22 23 ldflags = [ 24 "-s" 25 "-w" 26 "-X=main.version=${version}" 27 ]; 28 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 ''; 35 36 meta = { 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 = lib.licenses.mit; 41 maintainers = with lib.maintainers; [ Ligthiago ]; 42 mainProgram = "sttr"; 43 }; 44}