File tree Expand file tree Collapse file tree 4 files changed +118
-0
lines changed Expand file tree Collapse file tree 4 files changed +118
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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 "
Original file line number Diff line number Diff line change 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 ; } ;
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" ;
You can’t perform that action at this time.
0 commit comments