
This repository provides a complete, declarative development environment configuration using Nix Flakes and Home Manager. Everything is configured through local modules and automatically installs all dependencies.
- Languages: Node.js, Bun, Cargo/Rust, Go, GCC
- Package Managers: Volta (Node.js), Cargo, Bun
- Build Tools: Nil (Nix LSP), Nixd (Nix language server)
- Utilities: jq, bash, fd, ripgrep, coreutils, unzip, bat, yazi
- Fish Shell: Complete configuration with 400+ command completions
- Nushell: Modern shell with custom config and environment setup
- Zsh: Traditional shell with modern enhancements
- Starship: Cross-shell prompt with custom configuration
- Ghostty: Modern GPU-accelerated terminal with custom themes
- WezTerm: Feature-rich terminal with Lua configuration
- Tmux: Terminal multiplexer with custom key bindings
- Zellij: Modern terminal workspace (optional - see customization)
- Neovim: Fully configured IDE with LazyVim, AI assistants, and 40+ plugins
- Zed: Modern code editor with custom themes and settings
- Git & GitHub CLI: Pre-configured version control
- Lazy Git: Terminal UI for Git operations
- Claude Code CLI: Integrated AI coding assistant
- OpenCode: AI assistant integration
- Gemini CLI: Google's AI assistant (optional)
- Multiple AI providers: Support for various AI coding assistants
- Television: Modern file navigator and system monitor
- Zoxide: Smart directory jumping
- Atuin: Enhanced shell history
- Carapace: Universal shell completions
- FZF: Fuzzy finder integration
- Aerospace: Tiling window manager configuration (optional)
- Oil.nvim: Custom file navigation scripts
- Custom Scripts: Productivity-enhancing shell scripts
- Nerd Fonts: Iosevka Term for consistent typography
- Declarative Configuration: Everything version-controlled and reproducible
The flake automatically handles system-specific configurations, installs all dependencies, and sets up your complete development environment with a single command.
- Zero Configuration: Everything works out of the box
- Declarative: Version-controlled, reproducible environment
- Modern Toolchain: Latest development tools and utilities
- AI-Enhanced: Multiple AI coding assistants integrated
- Shell Agnostic: Fish, Nushell, and Zsh all configured
- Terminal Flexibility: Multiple terminal emulators supported
- macOS Optimized: Specifically tuned for macOS workflows
| Category | Tools |
|---|---|
| Package Manager | Nix with Flakes + Home Manager |
| Shells | Fish, Nushell, Zsh with Starship prompt |
| Terminals | Ghostty, WezTerm, Tmux, Zellij (optional) |
| Editor | Neovim (LazyVim) + Zed |
| Languages | Node.js, Rust, Go, with Volta management |
| AI Tools | Claude Code, OpenCode, Gemini (opt.), multiple providers |
| Navigation | Television, Yazi, Oil.nvim, Zoxide |
| Development | Git, GitHub CLI, Lazy Git |
. ├── flake.nix # Main Nix flake configuration ├── README.md # This file ├── fish.nix # Fish shell configuration ├── nushell.nix # Nushell configuration ├── zsh.nix # Zsh configuration ├── starship.nix # Starship prompt configuration ├── nvim.nix # Neovim configuration ├── ghostty.nix # Ghostty terminal configuration ├── wezterm.nix # WezTerm configuration ├── tmux.nix # Tmux configuration ├── zed.nix # Zed editor configuration ├── claude.nix # Claude Code CLI configuration ├── opencode.nix # OpenCode AI configuration ├── gemini.nix # Gemini CLI configuration (optional) ├── television.nix # Television file navigator ├── zellij.nix # Zellij terminal workspace (optional) ├── oil-scripts.nix # Custom Oil.nvim scripts ├── fish/ # Fish completions and configs ├── nvim/ # Neovim plugins and settings ├── ghostty/ # Ghostty themes and config ├── zed/ # Zed themes and settings ├── scripts/ # Custom utility scripts └── aerospace/ # Aerospace window manager config sh <(curl -L https://nixos.org/nix/install)To enable the experimental features for flakes and the new nix-command (needed for our declarative setup), create/edit the configuration file:
# For daemon installation (default on macOS)# The file may not exist, create it if needed sudo mkdir -p /etc/nix sudo nano /etc/nix/nix.conf # Or: sudo vi /etc/nix/nix.confAdd:
extra-experimental-features = flakes nix-command build-users-group = nixbld (This is necessary because support for flakes and the new Nix command is still experimental, but it allows us to have a fully declarative and reproducible configuration.)
No need to edit flake.nix for system configuration! The flake supports both Intel and Apple Silicon Macs.
You only need to update your username in flake.nix:
- Change
home.username = "YourUser";to your actual username - The home directory is automatically set to
/Users/YourUser
Configurations are automatically applied. Choose your preferred terminal:
Ghostty (Recommended): https://ghostty.org/download
- Reload config with Shift + Cmd + ,
- Modern GPU-accelerated with custom themes
- Optimized for performance
WezTerm: https://wezterm.org/installation.html
- Feature-rich with Lua configuration
- Cross-platform compatibility
- Advanced customization options
For tiling window management, copy the Aerospace configuration:
cp ./aerospace/.aerospace.toml ~/Aerospace provides:
- Automatic window tiling
- Workspace management
- Keyboard-driven navigation
- macOS-native integration
Before running the flake configuration, you need to set up Home Manager:
# Add home-manager channel nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager # Update channels nix-channel --update # Install home-manager nix-shell '<home-manager>' -A installOnce you have cloned the repository and are inside its directory, run the command for your system.
. to find the flake.nix file.
For any Mac (the flake auto-detects your system):
home-manager switch --flake .#gentlemanAlternative: Specific system configurations:
Apple Silicon Macs (M1/M2/M3/M4):
home-manager switch --flake .#gentleman-macos-armIntel Macs:
home-manager switch --flake .#gentleman-macos-intel
(These commands apply the configuration defined in the flake, installing all dependencies and applying the necessary settings.)
PATH is configured automatically on macOS!
Now run the following script to add Nushell, Fish or Zsh to your list of available shells and select it as the default one:
Fish (Recommended):
shellPath="$HOME/.local/state/nix/profiles/home-manager/home-path/bin/fish"&& sudo sh -c "grep -Fxq '$shellPath' /etc/shells || echo '$shellPath' >> /etc/shells"&& sudo chsh -s "$shellPath""$USER"Nushell:
shellPath="$HOME/.local/state/nix/profiles/home-manager/home-path/bin/nu"&& sudo sh -c "grep -Fxq '$shellPath' /etc/shells || echo '$shellPath' >> /etc/shells"&& sudo chsh -s "$shellPath""$USER"Zsh:
shellPath="$HOME/.local/state/nix/profiles/home-manager/home-path/bin/zsh"&& sudo sh -c "grep -Fxq '$shellPath' /etc/shells || echo '$shellPath' >> /etc/shells"&& sudo chsh -s "$shellPath""$USER"- Declarative Setup: All configurations are defined in Nix modules
- Automatic Deployment: Files are copied to correct macOS locations
- Dependency Management: All tools and dependencies installed automatically
- Version Pinning: Reproducible builds with locked versions
- System Integration: Proper PATH configuration and shell integration
Configurations are automatically deployed to:
| Tool | Location |
|---|---|
| Nushell | ~/Library/Application Support/nushell/ |
| Fish | ~/.config/fish/ |
| Ghostty | ~/.config/ghostty/ |
| WezTerm | ~/.wezterm.lua |
| Neovim | ~/.config/nvim/ |
| Zed | ~/Library/Application Support/Zed/ |
| Starship | ~/.config/starship.toml |
| Tmux | ~/.config/tmux/ |
| Zellij | ~/.config/zellij/ (optional) |
| Television | ~/.config/television/ |
- Shell Completions: 400+ Fish completions for better productivity
- Smart History: Atuin for enhanced command history across shells
- Fuzzy Finding: FZF integration for quick file/command finding
- Directory Navigation: Zoxide for intelligent directory jumping
- File Management: Yazi and Television for modern file browsing
- Git Workflow: Lazy Git for streamlined version control
- Claude Code Integration: Native AI coding assistant
- Multiple AI Providers: Support for various AI services
- Context-Aware: AI tools integrated with your development workflow
- Productivity Focused: AI assistants configured for maximum productivity
- Consistent Themes: Catppuccin and custom themes across all tools
- Nerd Font Support: Iosevka Term for perfect icon rendering
- GPU Acceleration: Modern terminals with hardware acceleration
- Custom Key Bindings: Vim-like navigation across all tools
Command not found after installation:
hash -r # Refresh command cachesource~/.zshrc # or ~/.bashrcNix installation issues:
- Ensure
/etc/nix/nix.confhas experimental features enabled - Restart terminal after Nix installation
- Check that you're in the project directory when running commands
Terminal not picking up themes:
- For Ghostty: Use Shift + Cmd + , to reload config
- For WezTerm: Restart the terminal
- Verify config files are in correct locations
Adding your own configurations:
- Edit the relevant
.nixfiles - Run the installation command again
- Changes are applied automatically
Managing versions:
- Update
flake.lockwith:nix flake update - Pin specific package versions in the flake
Enabling Optional Configurations:
Some configurations are commented out by default. To enable them:
Zellij Terminal Workspace:
# Edit flake.nix and uncomment the Zellij line sed -i '''s|# ./zellij.nix|./zellij.nix|' flake.nix # Re-run the installation nix run github:nix-community/home-manager -- switch --flake .#gentleman-macos-arm -b backup
Features:
- Modern terminal multiplexer alternative to tmux
- Vim-like keybindings with custom themes
- Plugin system with status bar and session management
- Custom layouts and workspace management
Additional Configuration Required: After enabling Zellij, you need to update shell configurations to use Zellij instead of tmux:
Fish Shell (
~/.config/fish/config.fish):# Change line ~31 from:ifnotset-q TMUX; andnotset-q ZED_TERMINAL tmux # To:ifnotset-q ZELLIJ; andnotset-q ZED_TERMINAL zellij
Zsh Shell (
~/.zshrc):# Change lines ~100-102 from: WM_VAR="/$TMUX" WM_CMD="tmux"# To: WM_VAR="/$ZELLIJ" WM_CMD="zellij"
Nushell (
~/.config/nushell/config.nu):# Change lines ~1015-1016 from:letMULTIPLEXER="tmux"letMULTIPLEXER_ENV_PREFIX="TMUX"# To:letMULTIPLEXER="zellij"letMULTIPLEXER_ENV_PREFIX="ZELLIJ"
Gemini CLI Integration:
# Edit flake.nix and add Gemini module# Add './gemini.nix' to the modules list in flake.nix# Re-run the installation nix run github:nix-community/home-manager -- switch --flake .#gentleman-macos-arm -b backup
Features:
- Google's AI assistant CLI tool
- Integrated via Bun package manager
- Direct access with
geminicommand - Perfect for AI-powered development workflows
This configuration includes support for the following AI tools:
- Avante.nvim - AI-powered coding assistant
- CopilotChat.nvim - GitHub Copilot chat interface
- OpenCode.nvim - OpenCode AI integration
- CodeCompanion.nvim - Multi-AI provider support
- Claude Code.nvim - Claude AI integration (enabled by default)
- Gemini.nvim - Google Gemini integration
Claude Code is already enabled by default. To switch to a different AI assistant:
Navigate to the disabled plugins file:
nvim ~/.config/nvim/lua/plugins/disabled.luaDisable Claude Code by changing
enabled = truetoenabled = false:{"greggh/claude-code.nvim", enabled=false, -- Disable Claude Code },Enable your preferred AI assistant by changing
enabled = falsetoenabled = true:{"yetone/avante.nvim", enabled=true, -- Change to true to enable },Save the file and restart Neovim.
- Only enable ONE AI plugin at a time to avoid conflicts and keybinding issues
- Required CLI tools are automatically installed by the script:
- Claude Code CLI (
brew install --cask claude-code) - OpenCode CLI (
curl -fsSL https://opencode.ai/install | bash) - Gemini CLI (
brew install gemini-cli)
- Claude Code CLI (
- API keys may be required for some services - check each plugin's documentation
- Node.js 18+ is required for most AI plugins (automatically handled by the configuration)
To switch from one AI assistant to another:
- Set your current AI plugin to
enabled = false - Set your desired AI plugin to
enabled = true - Restart Neovim
- For beginners: Start with CodeCompanion.nvim - supports multiple AI providers
- For Claude users: Use Claude Code.nvim with the Claude Code CLI
- For GitHub Copilot users: Use CopilotChat.nvim
- For Google Gemini users: Use Gemini.nvim with the Gemini CLI
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Test your changes thoroughly
- Submit a pull request
For questions or issues, open a GitHub issue.
Happy coding! 🚀
— Gentleman Programming