kiro: init at 0.2.13

authored by Vuks69 and committed by Masum Reza cee55b8b 74b034b5

+190
+60
pkgs/by-name/ki/kiro/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + callPackage, 5 + vscode-generic, 6 + fetchurl, 7 + extraCommandLineArgs ? "", 8 + useVSCodeRipgrep ? stdenv.hostPlatform.isDarwin, 9 + }: 10 + 11 + let 12 + sources = (lib.importJSON ./sources.json).${stdenv.hostPlatform.system}; 13 + in 14 + (callPackage vscode-generic { 15 + inherit useVSCodeRipgrep; 16 + commandLineArgs = extraCommandLineArgs; 17 + 18 + version = "0.2.13"; 19 + pname = "kiro"; 20 + 21 + # You can find the current VSCode version in the About dialog: 22 + # workbench.action.showAboutDialog (Help: About) 23 + vscodeVersion = "1.94.0"; 24 + 25 + executableName = "kiro"; 26 + longName = "Kiro"; 27 + shortName = "kiro"; 28 + libraryName = "kiro"; 29 + iconName = "kiro"; 30 + 31 + src = fetchurl { 32 + url = sources.url; 33 + hash = sources.hash; 34 + }; 35 + sourceRoot = "Kiro"; 36 + patchVSCodePath = true; 37 + 38 + tests = { }; 39 + updateScript = ./update.sh; 40 + 41 + meta = { 42 + description = "IDE for Agentic AI workflows based on VS Code"; 43 + homepage = "https://kiro.dev"; 44 + license = lib.licenses.amazonsl; 45 + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 46 + maintainers = with lib.maintainers; [ vuks ]; 47 + platforms = [ 48 + "x86_64-linux" 49 + "x86_64-darwin" 50 + "aarch64-darwin" 51 + ]; 52 + mainProgram = "kiro"; 53 + }; 54 + 55 + }).overrideAttrs 56 + (oldAttrs: { 57 + passthru = (oldAttrs.passthru or { }) // { 58 + inherit sources; 59 + }; 60 + })
+14
pkgs/by-name/ki/kiro/sources.json
··· 1 + { 2 + "x86_64-linux": { 3 + "url": "https://prod.download.desktop.kiro.dev/releases/202508150626--distro-linux-x64-tar-gz/202508150626-distro-linux-x64.tar.gz", 4 + "hash": "sha256-ORgN7gOyHGkO/ewqy62H0oNweZz7ViUAuEtXM1WgYIE=" 5 + }, 6 + "x86_64-darwin": { 7 + "url": "https://prod.download.desktop.kiro.dev/releases/202508150626-Kiro-dmg-darwin-x64.dmg", 8 + "hash": "sha256-8lIiMfDxp8VuRG/tiuojtOksc6oGT0+ZPpSAriRmKYU=" 9 + }, 10 + "aarch64-darwin": { 11 + "url": "https://prod.download.desktop.kiro.dev/releases/202508150626-Kiro-dmg-darwin-arm64.dmg", 12 + "hash": "sha256-2WGLIspDErwa1CZmSTTFa4aNCi6T/8x3vDNalNsm4xQ=" 13 + } 14 + }
+110
pkgs/by-name/ki/kiro/update.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p curl gnugrep gnused jq 3 + # shellcheck shell=bash 4 + 5 + set -euo pipefail 6 + 7 + # Script configuration 8 + SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" 9 + PACKAGE_NIX="${SCRIPT_DIR}/package.nix" 10 + SOURCES_JSON="${SCRIPT_DIR}/sources.json" 11 + 12 + # Platform configuration 13 + declare -A PLATFORM_URLS=( 14 + ["x86_64-linux"]="https://prod.download.desktop.kiro.dev/stable/metadata-linux-x64-stable.json" 15 + ["x86_64-darwin"]="https://prod.download.desktop.kiro.dev/stable/metadata-dmg-darwin-x64-stable.json" 16 + ["aarch64-darwin"]="https://prod.download.desktop.kiro.dev/stable/metadata-dmg-darwin-arm64-stable.json" 17 + ) 18 + 19 + # Data storage 20 + declare -A platform_versions 21 + declare -A platform_urls 22 + declare -A platform_hashes 23 + 24 + # Error handling 25 + error_exit() { 26 + echo "Error: $1" >&2 27 + exit 1 28 + } 29 + 30 + # Script execution starts here 31 + echo "Starting Kiro update process..." 32 + 33 + # Fetch metadata for all platforms 34 + echo "Fetching platform information..." 35 + for platform in "${!PLATFORM_URLS[@]}"; do 36 + url="${PLATFORM_URLS[$platform]}" 37 + echo "Fetching metadata for $platform..." 38 + 39 + if ! response=$(curl -fsSL "$url"); then 40 + error_exit "Failed to fetch metadata for $platform from $url" 41 + fi 42 + 43 + # Extract file URL and version from metadata 44 + file_url=$(echo "$response" | jq -r ' 45 + .releases[0].updateTo 46 + | select(.url | test("\\.(tar|dmg)(\\.|$)")) 47 + | .url' | head -1) 48 + 49 + if [[ -z "$file_url" || "$file_url" == "null" ]]; then 50 + error_exit "Could not find a valid file URL for $platform in metadata" 51 + fi 52 + 53 + version=$(echo "$response" | jq -r '.currentRelease') 54 + if [[ -z "$version" || "$version" == "null" ]]; then 55 + error_exit "Could not extract version for $platform from metadata" 56 + fi 57 + 58 + platform_versions["$platform"]="$version" 59 + platform_urls["$platform"]="$file_url" 60 + done 61 + 62 + # Determine the maximum version 63 + max_version="" 64 + for platform in "${!platform_versions[@]}"; do 65 + version="${platform_versions[$platform]}" 66 + if [[ -z "$max_version" ]] || [[ "$version" > "$max_version" ]]; then 67 + max_version="$version" 68 + fi 69 + done 70 + echo "Latest version across all platforms: $max_version" 71 + 72 + # Check if update is needed 73 + if [[ ! -f "$PACKAGE_NIX" ]]; then 74 + error_exit "package.nix not found at $PACKAGE_NIX" 75 + fi 76 + current_version=$(grep -E '^ version = ' "$PACKAGE_NIX" | cut -d'"' -f2) 77 + if [[ -z "$current_version" ]]; then 78 + error_exit "Could not extract current version from package.nix" 79 + fi 80 + if [[ "$max_version" == "$current_version" ]]; then 81 + echo "No update needed. Current version is already the latest: $current_version" 82 + exit 0 83 + fi 84 + 85 + echo "Updating to version: $max_version" 86 + echo "Calculating hashes..." 87 + for platform in "${!platform_urls[@]}"; do 88 + echo " Calculating hash for $platform..." 89 + platform_hashes["$platform"]=$(nix hash convert --hash-algo sha256 "$(nix-prefetch-url "${platform_urls[$platform]}")") 90 + done 91 + 92 + # Update package.nix and generate sources.json 93 + echo "Updating package.nix..." 94 + sed -i "s/version = \".*\"/version = \"$max_version\"/" "$PACKAGE_NIX" 95 + 96 + echo "Generating sources.json..." 97 + json_content="{}" 98 + for platform in "${!platform_urls[@]}"; do 99 + json_content=$(echo "$json_content" | jq --arg platform "$platform" \ 100 + --arg url "${platform_urls[$platform]}" \ 101 + --arg hash "${platform_hashes[$platform]}" \ 102 + '. + {($platform): {url: $url, hash: $hash}}') 103 + done 104 + echo "$json_content" >"$SOURCES_JSON" 105 + 106 + echo "Successfully updated package.nix to version $max_version" 107 + echo "Hashes calculated and updated:" 108 + for platform in "${!platform_hashes[@]}"; do 109 + echo " $platform: ${platform_hashes[$platform]}" 110 + done
+6
pkgs/top-level/all-packages.nix
··· 13807 13807 nodejs = nodejs_20; 13808 13808 }; 13809 13809 13810 + kiro = callPackage ../by-name/ki/kiro/package.nix { 13811 + vscode-generic = ../applications/editors/vscode/generic.nix; 13812 + }; 13813 + kiro-fhs = kiro.fhs; 13814 + kiro-fhsWithPackages = kiro.fhsWithPackages; 13815 + 13810 13816 whispers = with python3Packages; toPythonApplication whispers; 13811 13817 13812 13818 # Should always be the version with the most features