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