Compare commits
	
		
			5 Commits
		
	
	
		
			b26187ae7d
			...
			main
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 51038c5b6c | |||
| 8f02cf55b2 | |||
| 77fac19667 | |||
| 21673b7396 | |||
| 27a4764e00 | 
							
								
								
									
										5
									
								
								pkgs/by-name/cl/claude-code-acp/info.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								pkgs/by-name/cl/claude-code-acp/info.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | |||||||
|  | { | ||||||
|  |   "version": "0.6.7", | ||||||
|  |   "srcHash": "sha256-v32Q02ALWw6Upd4rrHGZH7Vt25+xSnKJCNGJob/irgM=", | ||||||
|  |   "npmDepsHash": "sha256-oUAHkB4EPuo8YCxi9Y/Lc8cipjJQ05o51MpdUsCjiiQ=" | ||||||
|  | } | ||||||
							
								
								
									
										36
									
								
								pkgs/by-name/cl/claude-code-acp/package.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								pkgs/by-name/cl/claude-code-acp/package.nix
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | |||||||
|  | { | ||||||
|  |   lib, | ||||||
|  |   buildNpmPackage, | ||||||
|  |   fetchFromGitHub, | ||||||
|  | }: | ||||||
|  | let | ||||||
|  |   info = lib.importJSON ./info.json; | ||||||
|  | in | ||||||
|  | buildNpmPackage { | ||||||
|  |   pname = "claude-code-acp"; | ||||||
|  |   version = info.version; | ||||||
|  |  | ||||||
|  |   src = fetchFromGitHub { | ||||||
|  |     owner = "zed-industries"; | ||||||
|  |     repo = "claude-code-acp"; | ||||||
|  |     rev = "v${info.version}"; | ||||||
|  |     hash = info.srcHash; | ||||||
|  |   }; | ||||||
|  |  | ||||||
|  |   npmDepsHash = info.npmDepsHash; | ||||||
|  |  | ||||||
|  |   # The package uses TypeScript and builds before publishing | ||||||
|  |   npmBuildScript = "build"; | ||||||
|  |  | ||||||
|  |   passthru = { | ||||||
|  |     updateScript = ./update.mjs; | ||||||
|  |   }; | ||||||
|  |  | ||||||
|  |   meta = { | ||||||
|  |     description = "Use Claude Code from any ACP client such as Zed"; | ||||||
|  |     homepage = "https://github.com/zed-industries/claude-code-acp"; | ||||||
|  |     license = lib.licenses.asl20; | ||||||
|  |     maintainers = with lib.maintainers; [ ]; | ||||||
|  |     mainProgram = "claude-code-acp"; | ||||||
|  |   }; | ||||||
|  | } | ||||||
							
								
								
									
										77
									
								
								pkgs/by-name/cl/claude-code-acp/update.mjs
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										77
									
								
								pkgs/by-name/cl/claude-code-acp/update.mjs
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,77 @@ | |||||||
|  | #! /usr/bin/env nix-shell | ||||||
|  | /* | ||||||
|  | #! nix-shell -i zx  -p nix-prefetch-github -p zx | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | import { readFileSync, writeFileSync } from "fs"; | ||||||
|  | import { dirname, join } from "path"; | ||||||
|  | import { fileURLToPath } from "url"; | ||||||
|  |  | ||||||
|  | const __filename = fileURLToPath(import.meta.url); | ||||||
|  | const __dirname = dirname(__filename); | ||||||
|  |  | ||||||
|  | // GitHub API endpoint for latest release | ||||||
|  | const GITHUB_API = "https://api.github.com/repos/zed-industries/claude-code-acp/releases/latest"; | ||||||
|  |  | ||||||
|  | // Read current info.json | ||||||
|  | const infoPath = join(__dirname, "info.json"); | ||||||
|  | const currentInfo = JSON.parse(readFileSync(infoPath, "utf-8")); | ||||||
|  |  | ||||||
|  | console.log(`Current version: ${currentInfo.version}`); | ||||||
|  |  | ||||||
|  | // Fetch latest release from GitHub | ||||||
|  | console.log("Fetching latest release from GitHub..."); | ||||||
|  | const response = await fetch(GITHUB_API); | ||||||
|  | const release = await response.json(); | ||||||
|  |  | ||||||
|  | const latestVersion = release.tag_name.replace(/^v/, ""); // Remove 'v' prefix | ||||||
|  | console.log(`Latest version: ${latestVersion}`); | ||||||
|  |  | ||||||
|  | if (currentInfo.version === latestVersion) { | ||||||
|  |   console.log("Already up to date!"); | ||||||
|  |   process.exit(0); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // Update version | ||||||
|  | currentInfo.version = latestVersion; | ||||||
|  |  | ||||||
|  | // Prefetch source hash | ||||||
|  | console.log("Prefetching source hash..."); | ||||||
|  | const srcHashOutput = await $`nix-prefetch-github zed-industries claude-code-acp --rev v${latestVersion}`; | ||||||
|  | const srcPrefetch = JSON.parse(srcHashOutput.stdout); | ||||||
|  | currentInfo.srcHash = srcPrefetch.hash; | ||||||
|  |  | ||||||
|  | console.log(`Source hash: ${currentInfo.srcHash}`); | ||||||
|  |  | ||||||
|  | // Write temporary info.json to get npmDepsHash | ||||||
|  | writeFileSync(infoPath, JSON.stringify(currentInfo, null, 2) + "\n"); | ||||||
|  |  | ||||||
|  | // Prefetch npm dependencies hash | ||||||
|  | console.log("Prefetching npm dependencies hash..."); | ||||||
|  | try { | ||||||
|  |   // This will fail with the expected hash in the error message | ||||||
|  |   await $`nix build .#claude-code-acp`; | ||||||
|  |  | ||||||
|  | } catch (error) { | ||||||
|  |   // Extract hash from error message | ||||||
|  |   const errorOutput = error.stderr; | ||||||
|  |   const hashMatch = errorOutput.match(/got:\s+(sha256-[A-Za-z0-9+/=]+)/); | ||||||
|  |  | ||||||
|  |   if (hashMatch) { | ||||||
|  |     currentInfo.npmDepsHash = hashMatch[1]; | ||||||
|  |     console.log(`npm deps hash: ${currentInfo.npmDepsHash}`); | ||||||
|  |   } else { | ||||||
|  |     console.error("Failed to extract npmDepsHash from build output"); | ||||||
|  |     console.error("You may need to update it manually by running:"); | ||||||
|  |     console.error(`  nix-build -A claude-code-acp`); | ||||||
|  |     console.error("and copying the hash from the error message"); | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // Write final info.json | ||||||
|  | writeFileSync(infoPath, JSON.stringify(currentInfo, null, 2) + "\n"); | ||||||
|  |  | ||||||
|  | console.log("\nUpdate complete!"); | ||||||
|  | console.log(`Version: ${currentInfo.version}`); | ||||||
|  | console.log(`Source hash: ${currentInfo.srcHash}`); | ||||||
|  | console.log(`npm deps hash: ${currentInfo.npmDepsHash}`); | ||||||
							
								
								
									
										6281
									
								
								pkgs/by-name/fl/flightcore/cargo-lock.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6281
									
								
								pkgs/by-name/fl/flightcore/cargo-lock.patch
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										72
									
								
								pkgs/by-name/fl/flightcore/package.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								pkgs/by-name/fl/flightcore/package.nix
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,72 @@ | |||||||
|  | { | ||||||
|  |   lib, | ||||||
|  |   stdenv, | ||||||
|  |   rustPlatform, | ||||||
|  |   jq, | ||||||
|  |   moreutils, | ||||||
|  |   fetchNpmDeps, | ||||||
|  |   cargo-tauri, | ||||||
|  |   glib-networking, | ||||||
|  |   nodejs, | ||||||
|  |   npmHooks, | ||||||
|  |   openssl, | ||||||
|  |   pkg-config, | ||||||
|  |   webkitgtk_4_1, | ||||||
|  |   wrapGAppsHook4, | ||||||
|  |   fetchFromGitHub, | ||||||
|  | }: | ||||||
|  |  | ||||||
|  | rustPlatform.buildRustPackage (finalAttrs: { | ||||||
|  |   pname = "flightcore"; | ||||||
|  |   version = "3.2.0"; | ||||||
|  |   src = fetchFromGitHub { | ||||||
|  |     owner = "R2NorthstarTools"; | ||||||
|  |     repo = "FlightCore"; | ||||||
|  |     rev = "v${finalAttrs.version}"; | ||||||
|  |     sha256 = "sha256-MFnW9cXFzqmdtC31r8cRcihV3NjGAC6+2/DnNVMheCI="; | ||||||
|  |   }; | ||||||
|  |   patches = [ ./cargo-lock.patch ]; | ||||||
|  |   cargoDeps = rustPlatform.fetchCargoVendor { | ||||||
|  |     src = finalAttrs.src; | ||||||
|  |     sourceRoot = "${finalAttrs.src.name}/${finalAttrs.cargoRoot}"; | ||||||
|  |     hash = "sha256-Jh0DAX4fGy2Z1+hpq+bkU/VYy2JAL2u+neUIsQ2QXBU="; | ||||||
|  |     patchFlags = "-p2"; | ||||||
|  |     inherit (finalAttrs) patches; | ||||||
|  |   }; | ||||||
|  |   postPatch = '' | ||||||
|  |     jq '.bundle.createUpdaterArtifacts = false' src-tauri/tauri.conf.json | sponge src-tauri/tauri.conf.json | ||||||
|  |   ''; | ||||||
|  |   npmDeps = fetchNpmDeps { | ||||||
|  |     name = "${finalAttrs.pname}-${finalAttrs.version}-npm-deps"; | ||||||
|  |     src = "${finalAttrs.src}/src-vue"; | ||||||
|  |     hash = "sha256-QhUPkCBK1kcAF7gByFxlg8Ca9PLF3evCl0QYEPP/Q2c="; | ||||||
|  |   }; | ||||||
|  |  | ||||||
|  |   nativeBuildInputs = [ | ||||||
|  |     cargo-tauri.hook | ||||||
|  |  | ||||||
|  |     nodejs | ||||||
|  |     npmHooks.npmConfigHook | ||||||
|  |  | ||||||
|  |     pkg-config | ||||||
|  |  | ||||||
|  |     jq | ||||||
|  |     moreutils | ||||||
|  |   ] | ||||||
|  |   ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook4 ]; | ||||||
|  |  | ||||||
|  |   buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ | ||||||
|  |     glib-networking | ||||||
|  |     openssl | ||||||
|  |     webkitgtk_4_1 | ||||||
|  |   ]; | ||||||
|  |  | ||||||
|  |   cargoRoot = "src-tauri"; | ||||||
|  |   npmRoot = "src-vue"; | ||||||
|  |  | ||||||
|  |   buildAndTestSubdir = finalAttrs.cargoRoot; | ||||||
|  |  | ||||||
|  |   meta = { | ||||||
|  |     description = "FlightCore A Northstar installer, updater, and mod-manager"; | ||||||
|  |   }; | ||||||
|  | }) | ||||||
| @@ -24,7 +24,7 @@ stdenv.mkDerivation { | |||||||
|  |  | ||||||
|   dontBuild = true; |   dontBuild = true; | ||||||
|  |  | ||||||
|   patches = [ ./fix-scripts.patch ]; |   # patches = [ ./fix-scripts.patch ]; | ||||||
|  |  | ||||||
|   buildInputs = [ |   buildInputs = [ | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "ungoogled-chromium": { |   "ungoogled-chromium": { | ||||||
|     "version": "141.0.7390.65", |     "version": "141.0.7390.107", | ||||||
|     "deps": { |     "deps": { | ||||||
|       "depot_tools": { |       "depot_tools": { | ||||||
|         "rev": "3f41e54ae17d53d4a39feecad64c3d3e6871b219", |         "rev": "3f41e54ae17d53d4a39feecad64c3d3e6871b219", | ||||||
| @@ -12,16 +12,16 @@ | |||||||
|         "hash": "sha256-WERLGrReUATmn3RhxtmyZcJBxdIY/WZqBDranCLDYEg=" |         "hash": "sha256-WERLGrReUATmn3RhxtmyZcJBxdIY/WZqBDranCLDYEg=" | ||||||
|       }, |       }, | ||||||
|       "ungoogled-patches": { |       "ungoogled-patches": { | ||||||
|         "rev": "0.5.5", |         "rev": "0.5.7", | ||||||
|         "hash": "sha256-kP2fCRpPD9SegLjMVX4tMQxScFp5iynsS9/RM7VB2nU=" |         "hash": "sha256-FI4iNoS/7yzfWFiJws6fzltiLm4dvH0ztYd0P5GgYqM=" | ||||||
|       }, |       }, | ||||||
|       "npmHash": "sha256-i1eQ4YlrWSgY522OlFtGDDPmxE2zd1hDM03AzR8RafE=" |       "npmHash": "sha256-i1eQ4YlrWSgY522OlFtGDDPmxE2zd1hDM03AzR8RafE=" | ||||||
|     }, |     }, | ||||||
|     "DEPS": { |     "DEPS": { | ||||||
|       "src": { |       "src": { | ||||||
|         "url": "https://chromium.googlesource.com/chromium/src.git", |         "url": "https://chromium.googlesource.com/chromium/src.git", | ||||||
|         "rev": "b2ec783d2b51a396804a4e3e33f6586be09a4e2d", |         "rev": "1c008349f76ff3a317bf28316fc5008c0120deb4", | ||||||
|         "hash": "sha256-9jZ7411NThelyL0R5yoLXB0lOkydOI3v6K5ORhjqfF4=", |         "hash": "sha256-NRqWOkGrg/Y4wZi4WQDJ6CvsDpeseVgTc/iAnuPRy/U=", | ||||||
|         "recompress": true |         "recompress": true | ||||||
|       }, |       }, | ||||||
|       "src/third_party/clang-format/script": { |       "src/third_party/clang-format/script": { | ||||||
| @@ -771,8 +771,8 @@ | |||||||
|       }, |       }, | ||||||
|       "src/third_party/webrtc": { |       "src/third_party/webrtc": { | ||||||
|         "url": "https://webrtc.googlesource.com/src.git", |         "url": "https://webrtc.googlesource.com/src.git", | ||||||
|         "rev": "bc7452c444245f7999be5711b1802e900f25540b", |         "rev": "d2eaa5570fc9959f8dbde32912a16366b8ee75f4", | ||||||
|         "hash": "sha256-Bqsd8b14ORREk/J3Tfs7OJXny0FdwUHO/sfCSEMEUSE=" |         "hash": "sha256-vWz+CAlgvavAmoCgy+D5FDGSyYoe15vfKI2fw33K8cc=" | ||||||
|       }, |       }, | ||||||
|       "src/third_party/wuffs/src": { |       "src/third_party/wuffs/src": { | ||||||
|         "url": "https://skia.googlesource.com/external/github.com/google/wuffs-mirror-release-c.git", |         "url": "https://skia.googlesource.com/external/github.com/google/wuffs-mirror-release-c.git", | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user