push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
{
lib,
stdenv,
fetchurl,
autoPatchelfHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "confluent-cli";
version = "4.39.1";
# To get the latest version:
# curl -L https://cnfl.io/cli | sh -s -- -l | grep -v latest | sort -V | tail -n1
src =
let
selectSystem =
attrs:
attrs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
system = selectSystem {
x86_64-linux = "linux_amd64";
aarch64-linux = "linux_arm64";
x86_64-darwin = "darwin_amd64";
aarch64-darwin = "darwin_arm64";
};
in
fetchurl {
url = "https://s3-us-west-2.amazonaws.com/confluent.cloud/confluent-cli/archives/${finalAttrs.version}/confluent_${finalAttrs.version}_${system}.tar.gz";
hash = selectSystem {
x86_64-linux = "sha256-8KhsFMQXoIPp1oZR5Q6u1yNoNvrCulbWq/rb6pMLhTU=";
aarch64-linux = "sha256-gLsNOAd9xzSbmenXhUN9nDGyFObtB2IG2z+OxHjrMSM=";
x86_64-darwin = "sha256-t0PcZd3n2Bayct4/h/JtCJwyKYjtMaXmOvvrlJ6LzGc=";
aarch64-darwin = "sha256-sSJd87dzsYLCdpP3tw4cMTyhnxmku70g1rCqhxGImGA=";
};
};
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
dontStrip = stdenv.hostPlatform.isDarwin;
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,share/doc/confluent-cli}
cp confluent $out/bin/
cp LICENSE $out/share/doc/confluent-cli/
cp -r legal $out/share/doc/confluent-cli/
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = {
description = "Confluent CLI";
homepage = "https://docs.confluent.io/confluent-cli/current/overview.html";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfreeRedistributable;
maintainers = with lib.maintainers; [
rguevara84
autophagy
];
# TODO: There's support for i686 systems but I do not have any such system
# to build it locally on, it's also unfree so I cannot rely on ofborg to
# build it. Get the list of supported system by looking at the list of
# files in the S3 bucket:
#
# https://s3-us-west-2.amazonaws.com/confluent.cloud?prefix=confluent-cli/archives/1.25.0/&delimiter=/%27
platforms = lib.platforms.unix;
};
})

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash nix curl coreutils jq common-updater-scripts
set -eou pipefail
latestVersion=$(curl -s "https://s3-us-west-2.amazonaws.com/confluent.cloud?prefix=confluent-cli/archives/&delimiter=/" |
sed 's/></>\n</g' |
grep '<Prefix>confluent-cli/archives/' |
sed -n 's#<Prefix>confluent-cli/archives/\(v\?\)\([^/]*\)/</Prefix>#\2#p' |
grep -v '^latest$' |
sort --version-sort |
tail -n1)
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; confluent-cli.version or (lib.getVersion confluent-cli)" | tr -d '"')
echo "latest version: $latestVersion"
echo "current version: $currentVersion"
if [[ "$latestVersion" == "$currentVersion" ]]; then
echo "package is up-to-date"
exit 0
fi
for i in \
"x86_64-linux linux_amd64" \
"aarch64-linux linux_arm64" \
"x86_64-darwin darwin_amd64" \
"aarch64-darwin darwin_arm64"; do
set -- $i
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url "https://s3-us-west-2.amazonaws.com/confluent.cloud/confluent-cli/archives/$latestVersion/confluent_${latestVersion}_$2.tar.gz"))
update-source-version confluent-cli $latestVersion $hash --system=$1 --ignore-same-version
done