Nix Workstation: Declarative Dev Environment with Nix Flakes & Home Manager
Nov 4, 2025
π§© Nix Workstation β Cobraβs Declarative Dev Environment
A fully reproducible workstation built with Nix flakes and Home Manager.
Features:
- Zsh + Oh-My-Zsh + Powerlevel10k
- Autosuggestions & Syntax Highlighting
- Neovim with lazy.nvim, Treesitter, and LSPs
- Dev tools (Git, Bat, Eza, Fd, Ripgrep, Fzf, Tmux, Lazygit, etc.)
- Node 22, Python 3.12, Prettier, Terraform, Docker, AWS CLI
- ChatGPT CLI alias (
chat) vianpx - Direnv + Flakes + Home Manager integration
π Quick Start on a New Machine
-
Install Nix
-
Clone this repo
-
Activate Home Manager
-
Start your new shell
Powerlevel10k will open its first-time setup wizard.
π§ Development Shell
Enter your pinned dev environment:
Inside youβll find:
- Node 22, npm, and pip
- Language servers (TypeScript, Python, Bash, Lua, YAML)
- Terraform, kubectl, AWS CLI
- Aliases and OMZ prompt
chatalias for ChatGPT CLI (vianpx)
To leave the shell:
π OpenAI API Key
Create a private key file (do not commit this):
Reload your shell:
Test ChatGPT:
βοΈ Maintenance
Update all inputs (nixpkgs + Home Manager):
Re-apply configuration:
π§Ή Troubleshooting
| Issue | Fix |
|---|---|
powerlevel10k not found | Run make link-p10k or re-apply HM |
direnv conflict | Remove old profile installs: nix profile remove direnv nix-direnv |
terraform unfree error | allowUnfree = true already set in flake |
ChatGPT CLI says TOKEN missing | Ensure both OPENAI_API_KEY and TOKEN are exported |
π‘ Tips
ndalias β opens zsh in dev shell (nix develop -c zsh)nix fmtβ formats your flakenix flake showβ inspect available outputshome-manager newsβ view Home Manager changelog
π§° Stack Summary
| Component | Managed by | Notes |
|---|---|---|
| Shell | Home Manager | Zsh + OMZ + p10k |
| Editor | Home Manager | Neovim (lazy.nvim + LSPs) |
| CLIs | Home Manager | Git, Eza, Bat, Fzf, Ripgrep, etc. |
| Languages | DevShell | Node 22, Python 3.12 |
| AI | Alias | chat β ChatGPT CLI |
| Config | Flake | One file (flake.nix) = entire setup |
π Reproducibility
Everything except your API key is declarative.
To recreate this environment anywhere:
|
Enjoy your reproducible dev environment βοΈπ