From b5daaeea906e2c38a560e09ab1acbee8dfc30b96 Mon Sep 17 00:00:00 2001 From: RobWalt Date: Sun, 21 May 2023 15:22:30 +0200 Subject: [PATCH] codeberg-cli: init at v0.3.5 --- .../codeberg-cli/default.nix | 42 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 46 insertions(+) create mode 100644 pkgs/applications/version-management/codeberg-cli/default.nix diff --git a/pkgs/applications/version-management/codeberg-cli/default.nix b/pkgs/applications/version-management/codeberg-cli/default.nix new file mode 100644 index 000000000000..da16be94c33b --- /dev/null +++ b/pkgs/applications/version-management/codeberg-cli/default.nix @@ -0,0 +1,42 @@ +{ lib +, CoreServices +, Security +, fetchFromGitea +, installShellFiles +, openssl +, pkg-config +, rustPlatform +, stdenv +}: +rustPlatform.buildRustPackage rec { + pname = "codeberg-cli"; + version = "0.3.5"; + + src = fetchFromGitea { + domain = "codeberg.org"; + owner = "RobWalt"; + repo = "codeberg-cli"; + rev = "v${version}"; + hash = "sha256-KjH78yqfZoN24TBYyFZuxf7z9poRov0uFYQ8+eq9p/o="; + }; + + cargoHash = "sha256-RE4Zwa5vUWPc42w5GaaYkS6fLIbges1fAsOUuwqR2ag="; + nativeBuildInputs = [ pkg-config installShellFiles ]; + + buildInputs = [ openssl ] + ++ lib.optionals stdenv.isDarwin [ CoreServices Security ]; + + postInstall = '' + installShellCompletion --cmd berg \ + --bash <($out/bin/berg completion bash) \ + --fish <($out/bin/berg completion fish) \ + --zsh <($out/bin/berg completion zsh) + ''; + + meta = with lib; { + description = "CLI Tool for Codeberg similar to gh and glab"; + homepage = "https://codeberg.org/RobWalt/codeberg-cli"; + license = with licenses; [ agpl3Plus ]; + maintainers = with maintainers; [ robwalt ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c6bf4993f8a4..c3d5cc895264 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -453,6 +453,10 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Security; }; + codeberg-cli = callPackage ../applications/version-management/codeberg-cli { + inherit (darwin.apple_sdk.frameworks) Security CoreServices; + }; + conftest = callPackage ../development/tools/conftest { }; coldsnap = callPackage ../tools/admin/coldsnap {