1{
2 fetchFromGitea,
3 installShellFiles,
4 lib,
5 openssl,
6 pkg-config,
7 rustPlatform,
8 stdenv,
9}:
10rustPlatform.buildRustPackage rec {
11 pname = "codeberg-cli";
12 version = "0.4.11";
13
14 src = fetchFromGitea {
15 domain = "codeberg.org";
16 owner = "Aviac";
17 repo = "codeberg-cli";
18 rev = "v${version}";
19 hash = "sha256-wf9Ve7focNBo6fGsjBQpTIx+DtxOo73AIQ9uoV8Q88Q=";
20 };
21
22 cargoHash = "sha256-LmLMTnNwxih5HcrMUmQpVdIVz4KeHxcOFtOrNqgGPkA=";
23 nativeBuildInputs = [
24 pkg-config
25 installShellFiles
26 ];
27
28 buildInputs = [ openssl ];
29
30 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
31 installShellCompletion --cmd berg \
32 --bash <($out/bin/berg completion bash) \
33 --fish <($out/bin/berg completion fish) \
34 --zsh <($out/bin/berg completion zsh)
35 '';
36
37 meta = with lib; {
38 description = "CLI Tool for Codeberg similar to gh and glab";
39 homepage = "https://codeberg.org/Aviac/codeberg-cli";
40 license = with licenses; [ agpl3Plus ];
41 maintainers = with maintainers; [ robwalt ];
42 mainProgram = "berg";
43 };
44}