Initial commit
This commit is contained in:
commit
cfcc57a8bd
353 changed files with 18756 additions and 0 deletions
90
package/gemini-cli/package.nix
Normal file
90
package/gemini-cli/package.nix
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
buildNpmPackage,
|
||||
fetchFromGitHub,
|
||||
jq,
|
||||
pkg-config,
|
||||
clang_20,
|
||||
libsecret,
|
||||
ripgrep,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
buildNpmPackage (finalAttrs: {
|
||||
pname = "gemini-cli";
|
||||
version = "0.16.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "google-gemini";
|
||||
repo = "gemini-cli";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-EOiG7Ov+tY6UPci4A67kKcCItkTrrENOm1mSaWxKE94=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-JvzrbyiJHbKNRHoGll7eSH4dD6Hj5qnrh4F/upHPntI=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
jq
|
||||
pkg-config
|
||||
]
|
||||
++ lib.optionals stdenv.isDarwin [ clang_20 ]; # clang_21 breaks @vscode/vsce's optionalDependencies keytar
|
||||
|
||||
buildInputs = [
|
||||
ripgrep
|
||||
libsecret
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
mkdir -p packages/generated
|
||||
echo "export const GIT_COMMIT_INFO = { commitHash: '${finalAttrs.src.rev}' };" > packages/generated/git-commit.ts
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
# Remove node-pty dependency from package.json
|
||||
${jq}/bin/jq 'del(.optionalDependencies."node-pty")' package.json > package.json.tmp && mv package.json.tmp package.json
|
||||
|
||||
# Remove node-pty dependency from packages/core/package.json
|
||||
${jq}/bin/jq 'del(.optionalDependencies."node-pty")' packages/core/package.json > packages/core/package.json.tmp && mv packages/core/package.json.tmp packages/core/package.json
|
||||
|
||||
# Get rid of auto-update
|
||||
sed -i '/disableAutoUpdate: {/,/}/ s/default: false/default: true/' packages/cli/src/config/settingsSchema.ts
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/{bin,share/gemini-cli}
|
||||
|
||||
cp -r node_modules $out/share/gemini-cli/
|
||||
|
||||
rm -f $out/share/gemini-cli/node_modules/@google/gemini-cli
|
||||
rm -f $out/share/gemini-cli/node_modules/@google/gemini-cli-core
|
||||
rm -f $out/share/gemini-cli/node_modules/@google/gemini-cli-a2a-server
|
||||
rm -f $out/share/gemini-cli/node_modules/@google/gemini-cli-test-utils
|
||||
rm -f $out/share/gemini-cli/node_modules/gemini-cli-vscode-ide-companion
|
||||
cp -r packages/cli $out/share/gemini-cli/node_modules/@google/gemini-cli
|
||||
cp -r packages/core $out/share/gemini-cli/node_modules/@google/gemini-cli-core
|
||||
cp -r packages/a2a-server $out/share/gemini-cli/node_modules/@google/gemini-cli-a2a-server
|
||||
|
||||
ln -s $out/share/gemini-cli/node_modules/@google/gemini-cli/dist/index.js $out/bin/gemini
|
||||
chmod +x "$out/bin/gemini"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "AI agent that brings the power of Gemini directly into your terminal";
|
||||
homepage = "https://github.com/google-gemini/gemini-cli";
|
||||
license = lib.licenses.asl20;
|
||||
sourceProvenance = with lib.sourceTypes; [ fromSource ];
|
||||
maintainers = with lib.maintainers; [
|
||||
xiaoxiangmoe
|
||||
FlameFlag
|
||||
taranarmo
|
||||
];
|
||||
platforms = lib.platforms.all;
|
||||
mainProgram = "gemini";
|
||||
};
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue