From c63a05f7bd158964f9f2d467c9b74fd21af8528b Mon Sep 17 00:00:00 2001 From: Michael Doyle Date: Wed, 11 Nov 2026 22:10:48 -0500 Subject: [PATCH] chore(samples): remove deprecated Project IDX / Firebase Studio templates - Remove 8 samples/*/.idx/dev.nix environment configs and 5 IDX template files - Remove non-functional Try/Open in IDX badges and start:server:idx script --- samples/README.md | 9 --- samples/idx-template.json | 26 -------- samples/idx-template.nix | 26 -------- samples/js-character-generator/.idx/dev.nix | 59 ----------------- samples/js-character-generator/README.md | 19 ------ samples/js-character-generator/README_IDX.md | 7 -- .../js-character-generator/idx-template.json | 8 --- .../js-character-generator/idx-template.nix | 32 ---------- samples/js-chatbot/.idx/dev.nix | 64 ------------------- samples/js-chatbot/package.json | 1 - samples/js-coffee-shop/.idx/dev.nix | 59 ----------------- samples/js-gemini/.idx/dev.nix | 59 ----------------- samples/js-menu/.idx/dev.nix | 53 --------------- samples/js-openai/.idx/dev.nix | 58 ----------------- samples/js-prompts/.idx/dev.nix | 59 ----------------- samples/js-schoolAgent/.idx/dev.nix | 59 ----------------- 16 files changed, 598 deletions(-) delete mode 100644 samples/idx-template.json delete mode 100644 samples/idx-template.nix delete mode 100644 samples/js-character-generator/.idx/dev.nix delete mode 100644 samples/js-character-generator/README_IDX.md delete mode 100644 samples/js-character-generator/idx-template.json delete mode 100644 samples/js-character-generator/idx-template.nix delete mode 100644 samples/js-chatbot/.idx/dev.nix delete mode 100644 samples/js-coffee-shop/.idx/dev.nix delete mode 100644 samples/js-gemini/.idx/dev.nix delete mode 100644 samples/js-menu/.idx/dev.nix delete mode 100644 samples/js-openai/.idx/dev.nix delete mode 100644 samples/js-prompts/.idx/dev.nix delete mode 100644 samples/js-schoolAgent/.idx/dev.nix diff --git a/samples/README.md b/samples/README.md index 57a0af09fa..f958c28470 100644 --- a/samples/README.md +++ b/samples/README.md @@ -10,12 +10,3 @@ Take a look at some samples of Genkit in use: - [js-angular](js-angular/): Demo of streaming to an Angular frontend - [js-schoolAgent](js-schoolAgent/): A simple school assistant system with a routing agent and specialized agents - [js-prompts](js-prompts/): Shows off several prompting techniques - -These are also available in IDX, Google's Cloud-Based IDE, for you to try. - - - Try in IDX - diff --git a/samples/idx-template.json b/samples/idx-template.json deleted file mode 100644 index ca669a0db9..0000000000 --- a/samples/idx-template.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "Genkit Samples", - "description": "Genkit Samples", - "categories": ["GenAI"], - "icon": "https://www.gstatic.com/monospace/240513/logo_firebase.svg", - "publisher": "Firebase", - "host": { - "virtualization": true - }, - "params": [ - { - "id": "sample", - "name": "Sample", - "type": "enum", - "default": "js-character-generator", - "options": { - "js-character-generator": "Simple Character Generator", - "js-chatbot": "A chatbot using Vertex and Llama 3.1 or Gemini Flash", - "js-coffee-shop": "Coffeeshop w Several types of Prompt", - "js-schoolAgent": "A Multi-Agent School Assistant", - "js-prompts": "A sample with various prompt styles", - "js-menu": "Menu parsing with increasing levels of complex architectures" - } - } - ] -} diff --git a/samples/idx-template.nix b/samples/idx-template.nix deleted file mode 100644 index 67826dab6b..0000000000 --- a/samples/idx-template.nix +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -{pkgs, sample ? "js-character-generator", ...}: { - packages = [ - pkgs.nodejs - ]; - bootstrap = '' - mkdir "$out" - cp -rf ${./.}/${sample}/. "$out" - chmod -R u+w "$out" - ''; -} \ No newline at end of file diff --git a/samples/js-character-generator/.idx/dev.nix b/samples/js-character-generator/.idx/dev.nix deleted file mode 100644 index cb5066ef0e..0000000000 --- a/samples/js-character-generator/.idx/dev.nix +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -# To learn more about how to use Nix to configure your environment -# see: https://developers.google.com/idx/guides/customize-idx-env -{ pkgs, ... }: { - # Which nixpkgs channel to use. - channel = "stable-24.05"; # or "unstable" - # Use https://search.nixos.org/packages to find packages - packages = [ - pkgs.nodejs_20 - pkgs.util-linux - # pkgs.go - ]; - # Sets environment variables in the workspace - env = { - #TODO Get a API key from https://g.co/ai/idxGetGeminiKey - GOOGLE_GENAI_API_KEY = ""; - }; - idx = { - # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" - extensions = [ - # "vscodevim.vim" - # "golang.go" - ]; - - # Workspace lifecycle hooks - workspace = { - # Runs when a workspace is first created - onCreate = { - npm-install = "npm ci --no-audit --prefer-offline --no-progress --timing"; - default.openFiles = [ "README.md" "index.ts" ]; - }; - # Runs when the workspace is (re)started - onStart = { - run-server = "if [ -z \"\${GOOGLE_GENAI_API_KEY}\" ]; then \ - echo 'No Gemini API key detected, enter a Gemini API key from https://aistudio.google.com/app/apikey:' && \ - read -s GOOGLE_GENAI_API_KEY && \ - echo 'You can also add to .idx/dev.nix to automatically add to your workspace' - export GOOGLE_GENAI_API_KEY; \ - fi && \ - npm run genkit:dev"; - }; - }; - }; -} \ No newline at end of file diff --git a/samples/js-character-generator/README.md b/samples/js-character-generator/README.md index d75c726bb2..a5f201c0eb 100644 --- a/samples/js-character-generator/README.md +++ b/samples/js-character-generator/README.md @@ -1,22 +1,3 @@ # Character Generator - - - - - - Open in IDX - - - - -This sample is used as the Genkit template in Project IDX, you can check it out in IDX! - To run it locally, set a [Gemini API key](https://aistudio.google.com/app/apikey) in your environment with `export GEMINI_API_KEY=<>` and start the app with `npm install && npm run dev` diff --git a/samples/js-character-generator/README_IDX.md b/samples/js-character-generator/README_IDX.md deleted file mode 100644 index 55721ce3b0..0000000000 --- a/samples/js-character-generator/README_IDX.md +++ /dev/null @@ -1,7 +0,0 @@ -#Genkit - -This is a simple demonstration web app using the [Genkit Library](https://github.com/genkit-ai/genkit) with Gemini to characters for an adventure game. - -In IDX, get started by with API key at https://g.co/ai/idxGetGeminiKey and enter it in `.idx/dev.nix` and rebuild the environment. - -After rebuilding the environment, open a new terminal (`Ctrl`+ `` ` ``) and follow the link that said "Genkit Developer UI" to use Genkit's built-in local developer playground. diff --git a/samples/js-character-generator/idx-template.json b/samples/js-character-generator/idx-template.json deleted file mode 100644 index 4053528b64..0000000000 --- a/samples/js-character-generator/idx-template.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "Genkit", - "description": "Build a new web app using Genkit", - "categories": ["Web app", "AI ML"], - "icon": "https://www.gstatic.com/monospace/240513/logo_firebase.svg", - "params": [], - "publisher": "Google LLC" -} diff --git a/samples/js-character-generator/idx-template.nix b/samples/js-character-generator/idx-template.nix deleted file mode 100644 index e6b8e66a61..0000000000 --- a/samples/js-character-generator/idx-template.nix +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -{pkgs, language ? "js", tos ? "false", ... }: { - packages = [ - pkgs.nodejs - ]; - bootstrap = '' - mkdir "$out" - mkdir "$out"/.idx - cp -r ${./.idx}/. "$out/.idx/" - cp -f ${./package.json} "$out/package.json" - cp -f ${./package-lock.json} "$out/package-lock.json" - cp -f ${./index.ts} "$out/index.ts" - cp -f ${./.gitignore} "$out/.gitignore" - cp ${./README_IDX.md} "$out"/README.md - chmod -R u+w "$out" - ''; -} \ No newline at end of file diff --git a/samples/js-chatbot/.idx/dev.nix b/samples/js-chatbot/.idx/dev.nix deleted file mode 100644 index d22c3cc10c..0000000000 --- a/samples/js-chatbot/.idx/dev.nix +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -## Default Nix Environment for Typescript + Gemini Examples -## Requires the sample to be started with npx run genkit:dev - -# To learn more about how to use Nix to configure your environment -# see: https://developers.google.com/idx/guides/customize-idx-env -{ pkgs, ... }: { - # Which nixpkgs channel to use. - channel = "stable-24.05"; # or "unstable" - # Use https://search.nixos.org/packages to find packages - packages = [ - pkgs.nodejs_20 - pkgs.util-linux - ]; - # Sets environment variables in the workspace - env = { - }; - idx = { - # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" - extensions = [ - ]; - - # Workspace lifecycle hooks - workspace = { - # Runs when a workspace is first created - onCreate = { - npm-install = "npm run setup"; - default.openFiles = [ "README.md" "server/src/index.ts" ]; - }; - onStart = { - npm-run-server = "npm run start:server:idx"; - }; - }; - - previews = { - enable = true; - previews = { - web = { - cwd = "genkit-app"; - command = ["npm" "run" "start" "--" "--port" "$PORT"]; - env = { - PORT = "$PORT"; - }; - manager = "web"; - }; - }; - }; - }; -} \ No newline at end of file diff --git a/samples/js-chatbot/package.json b/samples/js-chatbot/package.json index ea2acb3b3b..a2acbfd939 100644 --- a/samples/js-chatbot/package.json +++ b/samples/js-chatbot/package.json @@ -3,7 +3,6 @@ "start": "concurrently npm:start:server npm:start:ng", "build": "cd server && npm run build && cd ../ && cd genkit-app && npm run build", "setup": "npm i && cd server && npm i && cd ../genkit-app && npm i", - "start:server:idx": "echo -e '\\033[1mChoose a Cloud Project with the Vertex APIs enabled\\033[0m in the popup\nSee https://console.cloud.google.com/apis/api/aiplatform.googleapis.com/metrics' && npm run start:server", "start:server": "cd server && npm run genkit:dev", "start:ng": "cd genkit-app && npm start" }, diff --git a/samples/js-coffee-shop/.idx/dev.nix b/samples/js-coffee-shop/.idx/dev.nix deleted file mode 100644 index cb498dd1c2..0000000000 --- a/samples/js-coffee-shop/.idx/dev.nix +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -## Default Nix Environment for Typescript + Gemini Examples -## Requires the sample to be started with npx run genkit:dev - -# To learn more about how to use Nix to configure your environment -# see: https://developers.google.com/idx/guides/customize-idx-env -{ pkgs, ... }: { - # Which nixpkgs channel to use. - channel = "stable-24.05"; # or "unstable" - # Use https://search.nixos.org/packages to find packages - packages = [ - pkgs.nodejs_20 - pkgs.util-linux - ]; - # Sets environment variables in the workspace - env = { - #TODO Get a API key from https://g.co/ai/idxGetGeminiKey - GOOGLE_GENAI_API_KEY = ""; - }; - idx = { - # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" - extensions = [ - ]; - - # Workspace lifecycle hooks - workspace = { - # Runs when a workspace is first created - onCreate = { - npm-install = "npm ci --no-audit --prefer-offline --no-progress --timing"; - default.openFiles = [ "README.md" "src/index.ts" ]; - }; - # Runs when the workspace is (re)started - onStart = { - run-server = "if [ -z \"\${GOOGLE_GENAI_API_KEY}\" ]; then \ - echo 'No Gemini API key detected, enter a Gemini API key from https://aistudio.google.com/app/apikey:' && \ - read -s GOOGLE_GENAI_API_KEY && \ - echo 'You can also add to .idx/dev.nix to automatically add to your workspace' - export GOOGLE_GENAI_API_KEY; \ - fi && \ - npm run genkit:dev"; - }; - }; - }; -} \ No newline at end of file diff --git a/samples/js-gemini/.idx/dev.nix b/samples/js-gemini/.idx/dev.nix deleted file mode 100644 index 78035a897d..0000000000 --- a/samples/js-gemini/.idx/dev.nix +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -## Default Nix Environment for Typescript + Gemini Examples -## Requires the sample to be started with npx run genkit:dev - -# To learn more about how to use Nix to configure your environment -# see: https://developers.google.com/idx/guides/customize-idx-env -{ pkgs, ... }: { - # Which nixpkgs channel to use. - channel = "stable-24.05"; # or "unstable" - # Use https://search.nixos.org/packages to find packages - packages = [ - pkgs.nodejs_20 - pkgs.util-linux - ]; - # Sets environment variables in the workspace - env = { - #TODO Get a API key from https://g.co/ai/idxGetGeminiKey - GOOGLE_GENAI_API_KEY = ""; - }; - idx = { - # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" - extensions = [ - ]; - - # Workspace lifecycle hooks - workspace = { - # Runs when a workspace is first created - onCreate = { - npm-install = "npm ci --no-audit --prefer-offline --no-progress --timing"; - default.openFiles = [ "README.md" "src/index.ts" ]; - }; - # Runs when the workspace is (re)started - onStart = { - run-server = "if [ -z \"\${GOOGLE_GENAI_API_KEY}\" ]; then \ - echo 'No Gemini API key detected, enter a Gemini API key from https://aistudio.google.com/app/apikey:' && \ - read -s GOOGLE_GENAI_API_KEY && \ - echo 'You can also set the key in .idx/dev.nix to automatically add to your workspace' - export GOOGLE_GENAI_API_KEY; \ - fi && \ - npm run genkit:dev"; - }; - }; - }; -} \ No newline at end of file diff --git a/samples/js-menu/.idx/dev.nix b/samples/js-menu/.idx/dev.nix deleted file mode 100644 index 1bb0393cd4..0000000000 --- a/samples/js-menu/.idx/dev.nix +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -## Default Nix Environment for Typescript + Gemini Examples -## Requires the sample to be started with npx run genkit:dev - -# To learn more about how to use Nix to configure your environment -# see: https://developers.google.com/idx/guides/customize-idx-env -{ pkgs, ... }: { - # Which nixpkgs channel to use. - channel = "stable-24.05"; # or "unstable" - # Use https://search.nixos.org/packages to find packages - packages = [ - pkgs.nodejs_20 - pkgs.util-linux - ]; - # Sets environment variables in the workspace - env = { - #TODO Get a API key from https://g.co/ai/idxGetGeminiKey - GOOGLE_GENAI_API_KEY = ""; - }; - idx = { - # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" - extensions = [ - ]; - - # Workspace lifecycle hooks - workspace = { - # Runs when a workspace is first created - onCreate = { - npm-install = "npm ci --no-audit --prefer-offline --no-progress --timing"; - default.openFiles = [ "README.md" "src/index.ts" ]; - }; - # Runs when the workspace is (re)started - onStart = { - run-server = "npm run genkit:dev"; - }; - }; - }; -} \ No newline at end of file diff --git a/samples/js-openai/.idx/dev.nix b/samples/js-openai/.idx/dev.nix deleted file mode 100644 index fb1a17cdd2..0000000000 --- a/samples/js-openai/.idx/dev.nix +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -## Default Nix Environment for Typescript + Gemini Examples -## Requires the sample to be started with npx run genkit:dev - -# To learn more about how to use Nix to configure your environment -# see: https://developers.google.com/idx/guides/customize-idx-env -{ pkgs, ... }: { - # Which nixpkgs channel to use. - channel = "stable-24.05"; # or "unstable" - # Use https://search.nixos.org/packages to find packages - packages = [ - pkgs.nodejs_20 - pkgs.util-linux - ]; - # Sets environment variables in the workspace - env = { - OPENAI_API_KEY = ""; - }; - idx = { - # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" - extensions = [ - ]; - - # Workspace lifecycle hooks - workspace = { - # Runs when a workspace is first created - onCreate = { - npm-install = "npm ci --no-audit --prefer-offline --no-progress --timing"; - default.openFiles = [ "README.md" "src/index.ts" ]; - }; - # Runs when the workspace is (re)started - onStart = { - run-server = "if [ -z \"\${OPENAI_API_KEY}\" ]; then \ - echo 'No OpenAI API key detected, enter your OpenAI API key:' && \ - read -s OPENAI_API_KEY && \ - echo 'You can also set the key in .idx/dev.nix to automatically add to your workspace' - export OPENAI_API_KEY; \ - fi && \ - npm run genkit:dev"; - }; - }; - }; -} \ No newline at end of file diff --git a/samples/js-prompts/.idx/dev.nix b/samples/js-prompts/.idx/dev.nix deleted file mode 100644 index 78035a897d..0000000000 --- a/samples/js-prompts/.idx/dev.nix +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -## Default Nix Environment for Typescript + Gemini Examples -## Requires the sample to be started with npx run genkit:dev - -# To learn more about how to use Nix to configure your environment -# see: https://developers.google.com/idx/guides/customize-idx-env -{ pkgs, ... }: { - # Which nixpkgs channel to use. - channel = "stable-24.05"; # or "unstable" - # Use https://search.nixos.org/packages to find packages - packages = [ - pkgs.nodejs_20 - pkgs.util-linux - ]; - # Sets environment variables in the workspace - env = { - #TODO Get a API key from https://g.co/ai/idxGetGeminiKey - GOOGLE_GENAI_API_KEY = ""; - }; - idx = { - # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" - extensions = [ - ]; - - # Workspace lifecycle hooks - workspace = { - # Runs when a workspace is first created - onCreate = { - npm-install = "npm ci --no-audit --prefer-offline --no-progress --timing"; - default.openFiles = [ "README.md" "src/index.ts" ]; - }; - # Runs when the workspace is (re)started - onStart = { - run-server = "if [ -z \"\${GOOGLE_GENAI_API_KEY}\" ]; then \ - echo 'No Gemini API key detected, enter a Gemini API key from https://aistudio.google.com/app/apikey:' && \ - read -s GOOGLE_GENAI_API_KEY && \ - echo 'You can also set the key in .idx/dev.nix to automatically add to your workspace' - export GOOGLE_GENAI_API_KEY; \ - fi && \ - npm run genkit:dev"; - }; - }; - }; -} \ No newline at end of file diff --git a/samples/js-schoolAgent/.idx/dev.nix b/samples/js-schoolAgent/.idx/dev.nix deleted file mode 100644 index 37515bfbde..0000000000 --- a/samples/js-schoolAgent/.idx/dev.nix +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -## Default Nix Environment for Typescript + Gemini Examples -## Requires the sample to be started with npx run genkit:dev - -# To learn more about how to use Nix to configure your environment -# see: https://developers.google.com/idx/guides/customize-idx-env -{ pkgs, ... }: { - # Which nixpkgs channel to use. - channel = "stable-24.05"; # or "unstable" - # Use https://search.nixos.org/packages to find packages - packages = [ - pkgs.nodejs_20 - pkgs.util-linux - ]; - # Sets environment variables in the workspace - env = { - #TODO Get a API key from https://g.co/ai/idxGetGeminiKey - GOOGLE_GENAI_API_KEY = ""; - }; - idx = { - # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" - extensions = [ - ]; - - # Workspace lifecycle hooks - workspace = { - # Runs when a workspace is first created - onCreate = { - npm-install = "npm ci --no-audit --prefer-offline --no-progress --timing"; - default.openFiles = [ "README.md" "src/terminal.ts" ]; - }; - # Runs when the workspace is (re)started - onStart = { - run-server = "if [ -z \"\${GOOGLE_GENAI_API_KEY}\" ]; then \ - echo 'No Gemini API key detected, enter a Gemini API key from https://aistudio.google.com/app/apikey:' && \ - read -s GOOGLE_GENAI_API_KEY && \ - echo 'You can also set the key in .idx/dev.nix to automatically add to your workspace' - export GOOGLE_GENAI_API_KEY; \ - fi && \ - npm run genkit:dev"; - }; - }; - }; -} \ No newline at end of file