nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, autoPatchelfHook, fetchurl, lib }:
2
3stdenv.mkDerivation rec {
4 pname = "ccloud-cli";
5 version = "0.202.0";
6
7 # To get the latest version:
8 # curl -L 'https://s3-us-west-2.amazonaws.com/confluent.cloud?prefix=ccloud-cli/archives/&delimiter=/' | nix run nixpkgs.libxml2 -c xmllint --format -
9 src = fetchurl (if stdenv.hostPlatform.isDarwin then {
10 url = "https://s3-us-west-2.amazonaws.com/confluent.cloud/ccloud-cli/archives/${version}/ccloud_v${version}_darwin_amd64.tar.gz";
11 sha256 = "1w7c7fwpjj6f26nmcgm6rkrl4v9zhdpygkh02la77n23lg8wxah5";
12 } else {
13 url = "https://s3-us-west-2.amazonaws.com/confluent.cloud/ccloud-cli/archives/${version}/ccloud_v${version}_linux_amd64.tar.gz";
14 sha256 = "1xbhv2viw8cbwv03rfq99jddnw5lwy812a8xby348290l323xi89";
15 });
16
17 nativeBuildInputs = [ autoPatchelfHook ];
18
19 installPhase = ''
20 mkdir -p $out/{bin,share/doc/ccloud-cli}
21 cp ccloud $out/bin/
22 cp LICENSE $out/share/doc/ccloud-cli/
23 cp -r legal $out/share/doc/ccloud-cli/
24 '';
25
26 meta = with lib; {
27 description = "Confluent Cloud CLI";
28 homepage = https://docs.confluent.io/current/cloud/cli/index.html;
29 license = licenses.unfree;
30 maintainers = with maintainers; [ kalbasit ];
31 platforms = platforms.linux ++ platforms.darwin;
32 };
33}