nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildGoModule,
4 fetchFromGitea,
5 installShellFiles,
6 stdenv,
7}:
8
9buildGoModule rec {
10 pname = "tea";
11 version = "0.11.1";
12
13 src = fetchFromGitea {
14 domain = "gitea.com";
15 owner = "gitea";
16 repo = "tea";
17 rev = "v${version}";
18 sha256 = "sha256-bphXaE5qPNzqn+PlzESZadpwbS6KryJEnL7hH/CBoTI=";
19 };
20
21 vendorHash = "sha256-Y9YDwfubT+RR1v6BTFD+A8GP2ArQaIIoMJmak+Vcx88=";
22
23 ldflags = [
24 "-X code.gitea.io/tea/cmd.Version=${version}"
25 ];
26
27 nativeBuildInputs = [ installShellFiles ];
28
29 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
30 installShellCompletion --cmd tea \
31 --bash <($out/bin/tea completion bash) \
32 --fish <($out/bin/tea completion fish) \
33 --zsh <($out/bin/tea completion zsh)
34
35 mkdir $out/share/powershell/ -p
36 $out/bin/tea completion pwsh > $out/share/powershell/tea.Completion.ps1
37
38 $out/bin/tea man --out $out/share/man/man1/tea.1
39 '';
40
41 meta = {
42 description = "Gitea official CLI client";
43 homepage = "https://gitea.com/gitea/tea";
44 license = lib.licenses.mit;
45 maintainers = with lib.maintainers; [
46 j4m3s
47 techknowlogick
48 ];
49 mainProgram = "tea";
50 };
51}