Something went wrong. Try again.
Something went wrong. Try again.
Development Shells #
Reproducible development environments using Nix.
Available Shells #
| Shell | Language | Version | Tools |
|---|---|---|---|
| python | Python | 3.13 | uv, black |
| java | Java | 21 | JDK |
| rust | Rust | stable | cargo, rustc |
| django | Python | 3.13 | uv, Django |
| chat | Python | 3.13 | uv, OpenAI SDK |
| stock-analysis | Python | 3.13 | uv, analysis libs |
| mcp-server | Python | 3.14 | uv, MCP SDK |
Usage #
# Enter a shell
nix develop .#python
# Run command without entering
nix develop .#python --command python script.py
# List all shells
nix flake show | grep devShells
Structure #
Each shell is in devShells/<name>/default.nix:
{pkgs, ...}:
pkgs.mkShell {
name = "shell-name";
buildInputs = with pkgs; [
package1
package2
];
shellHook = ''
echo "Shell activated"
'';
}
Adding a Shell #
- Create
devShells/myshell/default.nix:
{pkgs, ...}:
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
yarn
];
}
- Register in
flake-modules/dev-shells.nix:
myshell = import ../devShells/myshell {
inherit pkgs;
};
- Test:
git add devShells/myshell flake-modules/dev-shells.nix
nix develop .#myshell
Notes #
- chat shell loads OpenAI API key from
~/.openai-key - Shells work offline after first build
- Use direnv for automatic activation (add
.envrcwithuse flake .#shell)