-
-
Save sansal54/7fc751d1dd87d5cf704611d1157a537a to your computer and use it in GitHub Desktop.
Google IDX IDE - Python Development config file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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.python311 | |
pkgs.python311Packages.pip | |
]; | |
# Sets environment variables in the workspace | |
env = { }; | |
idx = { | |
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" | |
extensions = [ | |
"ms-toolsai.jupyter" | |
"ms-python.python" | |
"charliermarsh.ruff" | |
"KevinRose.vsc-python-indent" | |
"ms-python.debugpy" | |
"ms-toolsai.jupyter-keymap" | |
"ms-toolsai.jupyter-renderers" | |
"ms-toolsai.vscode-jupyter-cell-tags" | |
"ms-toolsai.vscode-jupyter-slideshow" | |
"saoudrizwan.claude-dev" | |
"codezombiech.gitignore" | |
"luma.jupyter" | |
"tamasfe.even-better-toml" | |
"usernamehw.errorlens" | |
"streetsidesoftware.code-spell-checker" | |
]; | |
# Enable previews | |
previews = { | |
enable = true; | |
previews = { | |
# web = { | |
# # Example: run "npm run dev" with PORT set to IDX's defined port for previews, | |
# # and show it in IDX's web preview panel | |
# command = ["npm" "run" "dev"]; | |
# manager = "web"; | |
# env = { | |
# # Environment variables to set for your server | |
# PORT = "$PORT"; | |
# }; | |
# }; | |
}; | |
}; | |
# Workspace lifecycle hooks | |
workspace = { | |
# Runs when a workspace is first created | |
onCreate = { | |
create-venv = '' | |
python -m venv .env | |
source .env/bin/activate | |
pip install poetry | |
''; | |
}; | |
# Runs when the workspace is (re)started | |
onStart = { | |
# Example: start a background task to watch and re-build backend code | |
# watch-backend = "npm run watch-backend"; | |
start_virtual_env = "source .env/bin/activate"; | |
}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment