Skip to content

Commit d4e4dc8

Browse files
committed
kurtosis: init at 1.11.2
1 parent 081fb91 commit d4e4dc8

File tree

4 files changed

+118
-0
lines changed

4 files changed

+118
-0
lines changed

pkgs/by-name/kurtosis/default.nix

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
lib,
3+
stdenvNoCC,
4+
fetchurl,
5+
system,
6+
...
7+
}: let
8+
version = "1.11.2";
9+
10+
kurtosisBinVersions = builtins.fromJSON (builtins.readFile ./hashes.json);
11+
12+
platformSpec = kurtosisBinVersions.${system};
13+
in
14+
stdenvNoCC.mkDerivation {
15+
pname = "kurtosis-cli";
16+
inherit version;
17+
18+
src = fetchurl {
19+
url = "https://github.com/kurtosis-tech/kurtosis-cli-release-artifacts/releases/download/${version}/kurtosis-cli_${version}_${platformSpec.platformSuffix}.tar.gz";
20+
inherit (platformSpec) hash;
21+
};
22+
23+
sourceRoot = ".";
24+
25+
installPhase = ''
26+
runHook preInstall
27+
28+
install -D -m755 kurtosis $out/bin/kurtosis
29+
30+
runHook postInstall
31+
'';
32+
33+
passthru.updateScript = ./update.sh;
34+
35+
meta = with lib; {
36+
description = "CLI for Kurtosis, a framework for building and running distributed systems";
37+
homepage = "https://github.com/kurtosis-tech/kurtosis";
38+
license = licenses.asl20;
39+
platforms = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
40+
mainProgram = "kurtosis";
41+
};
42+
}

pkgs/by-name/kurtosis/hashes.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"x86_64-linux": {
3+
"platformSuffix": "linux_amd64",
4+
"hash": "sha256-LOBM9ZmmX6xbzLk4y0/a1/p0Kf3c/uZhxZC0VYEXqq4="
5+
},
6+
"aarch64-linux": {
7+
"platformSuffix": "linux_arm64",
8+
"hash": "sha256-t/arwAnZaM4iU6Cfrj7yS/XqLN9fe7ROL9MDcQRZ0Xc="
9+
},
10+
"x86_64-darwin": {
11+
"platformSuffix": "darwin_amd64",
12+
"hash": "sha256-8JA26erRIrQzEIEMbEoMJdJl7YdNOvZwYs3MGXbvFWk="
13+
},
14+
"aarch64-darwin": {
15+
"platformSuffix": "darwin_arm64",
16+
"hash": "sha256-9Qv681k7lMhYTkiZEERoE1dmmlX+HdpYI1fOZqCO62U="
17+
}
18+
}

pkgs/by-name/kurtosis/update.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env nix-shell
2+
#!nix-shell -i bash -p curl jq nix-prefetch-url
3+
4+
set -euo pipefail
5+
6+
# Get the latest version from GitHub releases
7+
LATEST_VERSION=$(curl -s https://api.github.com/repos/kurtosis-tech/kurtosis-cli-release-artifacts/releases/latest | jq -r .tag_name)
8+
9+
echo "Latest version: $LATEST_VERSION"
10+
11+
# Update version in default.nix
12+
sed -i "s/version = \".*\";/version = \"$LATEST_VERSION\";/" "$(dirname "$0")/default.nix"
13+
14+
# Fetch hashes for all platforms
15+
declare -A PLATFORMS=(
16+
["x86_64-linux"]="linux_amd64"
17+
["aarch64-linux"]="linux_arm64"
18+
["x86_64-darwin"]="darwin_amd64"
19+
["aarch64-darwin"]="darwin_arm64"
20+
)
21+
22+
# Create temporary JSON
23+
TMP_JSON=$(mktemp)
24+
25+
echo "{" > "$TMP_JSON"
26+
27+
first=true
28+
for platform in "${!PLATFORMS[@]}"; do
29+
suffix="${PLATFORMS[$platform]}"
30+
url="https://github.com/kurtosis-tech/kurtosis-cli-release-artifacts/releases/download/${LATEST_VERSION}/kurtosis-cli_${LATEST_VERSION}_${suffix}.tar.gz"
31+
32+
echo "Fetching hash for $platform ($suffix)..."
33+
hash=$(nix-prefetch-url "$url" 2>/dev/null)
34+
sri_hash=$(nix hash to-sri --type sha256 "$hash" 2>/dev/null | head -n1)
35+
36+
if [ "$first" = true ]; then
37+
first=false
38+
else
39+
echo "," >> "$TMP_JSON"
40+
fi
41+
42+
cat >> "$TMP_JSON" << EOF
43+
"$platform": {
44+
"platformSuffix": "$suffix",
45+
"hash": "$sri_hash"
46+
}
47+
EOF
48+
done
49+
50+
echo "}" >> "$TMP_JSON"
51+
52+
# Pretty print and save
53+
jq . "$TMP_JSON" > "$(dirname "$0")/hashes.json"
54+
rm "$TMP_JSON"
55+
56+
echo "Updated to version $LATEST_VERSION"

pkgs/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
});
5252
geth = callPackage ./by-name/geth {};
5353
heimdall = callPackageUnstable ./by-name/heimdall {};
54+
kurtosis = callPackage ./by-name/kurtosis {};
5455
lighthouse = callPackage ./by-name/lighthouse {inherit foundry;};
5556
mcl = callPackage ./by-name/mcl {};
5657
mev-boost = callPackage ./by-name/mev-boost {inherit blst;};
@@ -112,6 +113,7 @@
112113
geth-faucet.bin = "faucet";
113114
geth-rlpdump.bin = "rlpdump";
114115
};
116+
kurtosis.bin = "kurtosis";
115117
lighthouse.bin = "lighthouse";
116118
mev-boost-relay.bin = "mev-boost-relay";
117119
mev-boost.bin = "mev-boost";

0 commit comments

Comments
 (0)