Skip to content

Instantly share code, notes, and snippets.

@sansal54
Forked from hossam-elshabory/div.nix
Created July 30, 2025 18:30
Show Gist options
  • Save sansal54/7fc751d1dd87d5cf704611d1157a537a to your computer and use it in GitHub Desktop.
Save sansal54/7fc751d1dd87d5cf704611d1157a537a to your computer and use it in GitHub Desktop.
Google IDX IDE - Python Development config file.
# 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