A declarative, reproducible dotfiles configuration using Nix and Home Manager. Works on Linux, macOS, and WSL2.
- Declarative Configuration - Everything defined in Nix for reproducibility
- Cross-Platform - Works on Linux, macOS, and WSL2
- Home Manager - Manages user environment with Nix
- Modern Tool Stack - Latest CLI tools and applications
- Vi Mode Everything - Consistent vi keybindings across all tools
- GPU-Accelerated Terminal - WezTerm with cross-platform support
- Automated CI - GitHub Actions validates all configurations
- Fish - Modern shell with vi mode, Catppuccin colors, and excellent autosuggestions
- z plugin - Directory jumper for quick navigation
- fzf.fish plugin - Enhanced fuzzy finding integration
- Custom functions for git, file search, and Nix shortcuts
- Starship - Fast, customizable prompt with git integration and language detection
- Zoxide - Smart directory jumper with frecency algorithm (better than cd)
- Direnv - Per-directory environment variables with Nix integration
- WezTerm - GPU-accelerated terminal (Linux/macOS, uses Windows WezTerm for WSL2)
- Neovim - Extensible editor with mini.nvim for minimal, powerful setup
- Tmux - Terminal multiplexer with Catppuccin theme
- Git - Version control with delta for beautiful diffs
- Lazygit - Terminal UI for git operations
- GitHub CLI - Manage GitHub from the command line
- eza - Modern ls replacement with icons and git integration
- fd - Modern find replacement (fast, user-friendly)
- ripgrep - Modern grep replacement (recursive, fast)
- bat - cat with syntax highlighting and line numbers
- fzf - Fuzzy finder for files, history, and more
- delta - Beautiful git diffs with syntax highlighting
- jq / yq-go - JSON and YAML processors
- htop - Interactive process viewer
- tree - Directory tree visualizer
- nixpkgs-fmt - Nix code formatter
- nil - Nix Language Server for IDE integration
- home-manager - Declarative user environment manager
- Development shell with additional tools available via
nix develop
- Git - For cloning this repository
- Curl - For installing Nix
- Linux, macOS, or WSL2 - Tested on Ubuntu 22.04+, macOS 13+, WSL2
# Clone the repository
git clone https://github.com/yourusername/dotfiles.git ~/dotfiles
cd ~/dotfiles
# Run the installer
./install.shThe installer will:
- Install Nix with flakes enabled
- Install Home Manager
- Build and activate your configuration
- Set Fish as your default shell
- Set up all tools and configurations
If you prefer more control:
# 1. Install Nix (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# 2. Enable flakes (if not already enabled)
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
# 3. Clone dotfiles
git clone https://github.com/yourusername/dotfiles.git ~/dotfiles
cd ~/dotfiles
# 4. Build and activate (choose your platform)
# For Linux:
nix build .#homeConfigurations."user@linux".activationPackage
./result/activate
# For WSL2:
nix build .#homeConfigurations."user@wsl".activationPackage
./result/activate
# For macOS:
nix build .#homeConfigurations."user@darwin".activationPackage
./result/activatedotfiles/
βββ flake.nix # Nix flake entry point
βββ flake.lock # Locked dependencies
βββ home.nix # Main Home Manager configuration
βββ install.sh # Nix-based installation script
βββ install-legacy.sh # Legacy bash-based installer (deprecated)
βββ README.md # This file
βββ CLAUDE.md # Claude Code instructions
β
βββ modules/ # Nix modules for each tool
β βββ common.nix # Common settings (SSH, GPG, readline)
β βββ fish.nix # Fish shell configuration
β βββ wezterm.nix # WezTerm terminal
β βββ neovim.nix # Neovim editor
β βββ starship.nix # Starship prompt
β βββ git.nix # Git configuration
β βββ tmux.nix # Tmux multiplexer
β
βββ config/ # Application configs
β βββ wezterm/
β βββ wezterm.lua # WezTerm config with OS detection
β
βββ nvim/ # Neovim configuration
β βββ init.lua # Main config
β βββ README.md # Neovim-specific documentation
β βββ lua/config/ # Lua modules
β βββ options.lua # Editor options
β βββ keymaps.lua # Key mappings
β βββ autocmds.lua # Auto commands
β βββ plugins.lua # Plugin configuration
β βββ util.lua # Utility functions
β
βββ wezterm/ # WezTerm documentation
β βββ README.md
β
βββ git/ # Git documentation
β βββ README.md
β
βββ tmux/ # Tmux documentation
β βββ README.md
β
βββ starship/ # Starship documentation
β βββ README.md
β
βββ lazygit/ # Lazygit documentation
β βββ README.md
β
βββ Legacy tools/ # Deprecated bash-based configs
β βββ zsh/ # (Use Fish via Nix instead)
β βββ sheldon/ # (Use Fish plugins via Nix instead)
β βββ homebrew/ # (Use Nix packages instead)
β βββ docker/ # (Standalone tool, not managed by Nix)
β βββ proto/ # (Standalone tool, not managed by Nix)
β βββ eza/ # (Use eza via Nix packages instead)
β
βββ .github/
βββ workflows/
βββ nix-check.yml # CI workflow
Note: This repository includes legacy bash-based installation scripts in individual tool directories (zsh/, docker/, etc.). These are deprecated and maintained only for reference. The modern, recommended approach is using the Nix flakes configuration described in this document.
The configuration automatically detects your platform and applies the correct settings:
- Linux (Generic): Full configuration with WezTerm - use
user@linux - WSL2: Configuration without WezTerm (uses Windows WezTerm) - use
user@wsl - NixOS on WSL2: Optimized for NixOS on WSL2 - use
nixos@wsl - macOS (Apple Silicon): Full configuration with WezTerm - use
user@darwin
If you're running NixOS (including NixOS-WSL), use the nixos@wsl configuration:
# Clone the repository
git clone https://github.com/yourusername/dotfiles.git ~/dotfiles
cd ~/dotfiles
# Build and activate for NixOS on WSL2
nix build .#homeConfigurations."nixos@wsl".activationPackage
./result/activate
# Or use home-manager directly
home-manager switch --flake .#nixos@wslThis configuration:
- Sets the username to
nixos(default NixOS-WSL user) - Sets home directory to
/home/nixos - Disables WezTerm (uses Windows terminal)
- Enables all other tools and configurations
When using WSL2, WezTerm runs on the Windows side but needs to access configuration from WSL. This setup creates a direct symbolic link from Windows to the WSL dotfiles directory.
Quick Setup (Recommended):
Use the automated setup script to get the exact commands for your system:
cd ~/dotfiles
./setup-wsl-wezterm.shThe script will:
- Verify you're in a WSL environment
- Detect your WSL distribution name and username
- Check that the wezterm config exists in dotfiles
- Provide customized PowerShell commands for Windows setup
Manual Setup:
If you prefer to set up manually:
Windows Side (PowerShell as Administrator):
# 1. Create .config directory if it doesn't exist
New-Item -ItemType Directory -Path "$env:USERPROFILE\.config" -Force
# 2. Create symbolic link directly to WSL dotfiles wezterm directory
# Replace <distro> with your WSL distribution name (check with: wsl -l -v)
# Replace <username> with your WSL username
New-Item -ItemType SymbolicLink -Path "$env:USERPROFILE\.config\wezterm" -Target "\\wsl$\<distro>\home\<username>\dotfiles\wezterm\"
# Example for NixOS:
# New-Item -ItemType SymbolicLink -Path "$env:USERPROFILE\.config\wezterm" -Target "\\wsl$\NixOS\home\nixos\dotfiles\wezterm\"
# Example for Ubuntu:
# New-Item -ItemType SymbolicLink -Path "$env:USERPROFILE\.config\wezterm" -Target "\\wsl$\Ubuntu\home\user\dotfiles\wezterm\"
# 3. Restart WezTerm
# 4. Verify configuration is loaded (theme, fonts, keybindings should match)Directory Structure:
Windows:
%USERPROFILE%\.config\wezterm\ β (symlink to \\wsl$\<distro>\home\<user>\dotfiles\wezterm\)
βββ wezterm.lua β Main entry point
βββ platform.lua β OS detection
βββ theme.lua β Colors and visual settings
βββ fonts.lua β Font configuration
βββ appearance.lua β Window appearance
βββ keybindings.lua β Keyboard shortcuts
βββ mouse.lua β Mouse bindings
βββ domains.lua β Domain configs (WSL, SSH, local)
βββ performance.lua β Performance settings
WSL:
~/dotfiles/wezterm/ β Source of truth (all config files)
How it works:
- Your dotfiles wezterm configuration is at
~/dotfiles/wezterm/in WSL - Windows
%USERPROFILE%\.config\weztermis a symbolic link directly to WSL~/dotfiles/wezterm/ - Windows WezTerm looks for config at
%USERPROFILE%\.config\wezterm\wezterm.lua - This resolves through the symlink to your dotfiles repo
- Result: All config changes in dotfiles auto-sync to Windows WezTerm
Modular Configuration:
The WezTerm config is now organized into modules:
theme.lua- Color schemes and visual effectsfonts.lua- Font family and sizing (platform-specific)appearance.lua- Window decorations, opacity, padding, tabskeybindings.lua- All keyboard shortcutsmouse.lua- Mouse button and wheel bindingsdomains.lua- WSL, SSH, and local shell configurationperformance.lua- Rendering and FPS settingsplatform.lua- OS detection utilities
Edit any module and WezTerm will pick up changes on reload (Ctrl+Shift+Alt+R or Cmd+Shift+R).
Troubleshooting:
If WezTerm doesn't detect the configuration:
-
Verify the symlink was created correctly:
# On Windows PowerShell: Get-Item "$env:USERPROFILE\.config\wezterm" | Select-Object LinkType, Target # Should show: # LinkType: SymbolicLink # Target: \\wsl$\<distro>\home\<username>\dotfiles\wezterm
-
Check that source files exist in WSL:
# On WSL: ls -la ~/dotfiles/wezterm/ # Should show wezterm.lua and all module files
-
Verify WSL path is accessible from Windows:
- Open Windows Explorer
- Navigate to:
\\wsl$\<distro>\home\<username>\dotfiles\wezterm - You should see all the .lua files
-
Common issues:
- Symlink creation fails: Enable Developer Mode in Windows Settings, or run PowerShell as Administrator
- WezTerm shows blank config: Make sure you're using the correct WSL distribution name (check with
wsl -l -v) - Permission denied: Ensure WSL filesystem is accessible from Windows
- File vs Directory error: If
%USERPROFILE%\.config\weztermis a file instead of a symlink, delete it first:Remove-Item "$env:USERPROFILE\.config\wezterm" -Force
Create ~/.config/git/config.local to set your Git identity:
[user]
name = Your Name
email = your.email@example.comAll configuration is in Nix files. To customize:
- Edit the relevant module in
modules/ - Rebuild with
nix-rebuildor./install.sh --rebuild
cd ~/dotfiles
./install.sh --updateOr use the convenience alias:
nix-updatecd ~/dotfiles
./install.sh --rebuildOr:
nix-rebuildNix allows you to rollback to previous configurations:
# List generations
home-manager generations
# Rollback to previous generation
home-manager generations | head -2 | tail -1 | awk '{print $7}' | xargs -I {} {}/activateAll tools use the Catppuccin Mocha color scheme for a consistent look:
- Dark, comfortable colors
- Excellent contrast
- Beautiful syntax highlighting
Vi Mode Navigation:
- Press
Esc- Enter normal mode - Visual mode indicators: π NORMAL, π INSERT, π ₯ VISUAL, π ‘ REPLACE
- Cursor changes by mode (block/line/underscore)
Built-in Keybindings:
Ctrl+R- Search command history with fzfCtrl+F- Accept autosuggestionAlt+F- Accept one word from autosuggestionAlt+E- Edit command in $EDITOR
Custom Functions:
f- Interactive file search with preview (fd + fzf + bat)fd_dir- Interactive directory search and cd (fd + fzf + eza)mkcd <dir>- Create directory and cd into itextract <file>- Extract any archive formatrebuild- Rebuild home-manager configurationnix-search <pkg>- Search for Nix packages
<Space>- Leader key<Space>e- File explorer<Space>ff- Find files<Space>fg- Live grep<Space>fb- Find buffers<Space>w- Save file
Ctrl+a- Prefix keyPrefix |- Split verticallyPrefix -- Split horizontallyPrefix h/j/k/l- Navigate panesPrefix H/J/K/L- Resize panes
Ctrl+Shift+D- Split horizontalCtrl+D- Split verticalCtrl+Shift+H/J/K/L- Navigate panesCtrl+Alt+H/J/K/L- Resize panesCtrl+Shift+T- New tabCtrl+Shift+W- Close pane
GitHub Actions automatically:
- Validates Nix flake syntax
- Builds all platform configurations
- Checks code formatting
- Validates module structure
- Tests Fish and Neovim configs
- Runs security audits
If the Determinate installer fails, try the official installer:
sh <(curl -L https://nixos.org/nix/install) --daemon# Find fish path
which fish
# Add to /etc/shells if needed
echo $(which fish) | sudo tee -a /etc/shells
# Change shell
chsh -s $(which fish)
# Log out and back in# Check flake for errors
nix flake check
# Try building with more verbose output
nix build .#homeConfigurations."user@linux".activationPackage --print-build-logs --show-trace# Check if config is linked correctly
ls -la ~/.config/wezterm/
# Manually link if needed
ln -sf ~/dotfiles/wezterm/wezterm.lua ~/.config/wezterm/wezterm.luaInstall a Nerd Font. With Nix:
# Add to home.nix packages:
pkgs.nerdfontsOr manually install JetBrains Mono Nerd Font from Nerd Fonts.
The repository includes a Nix development shell with additional tools:
cd ~/dotfiles
nix develop
# Now you have access to:
# - nixpkgs-fmt (format Nix files)
# - nil (Nix LSP)
# - home-manager CLIBefore activating changes system-wide, you can test build them:
# Test build for your platform
nix build .#homeConfigurations."user@linux".activationPackage
# Check flake for errors
nix flake check
# Format Nix files
nixpkgs-fmt **/*.nixinstall-legacy.sh and tool-specific install.sh scripts). These are maintained for reference only and are no longer the recommended installation method.
The legacy approach:
- Used bash scripts to manually install tools
- Required manual configuration of dotfiles
- Didn't provide reproducibility guarantees
- Used Homebrew on macOS, manual installs on Linux
Migration: If you're using the legacy setup, consider migrating to the Nix-based approach for better reproducibility and cross-platform consistency.
- Nix Pills - Learn Nix fundamentals
- Home Manager Manual - Official documentation
- NixOS Wiki - Community knowledge base
- Nix Flakes Guide - Understanding flakes
- Fish Shell Documentation
- Neovim Documentation
- WezTerm Documentation
- Starship Documentation
- Tmux Documentation
Contributions are welcome! Feel free to:
- Open issues for bugs or feature requests
- Submit pull requests with improvements
- Share your customizations
This project is licensed under the MIT License.
- NixOS - For the amazing package manager
- Home Manager - For user environment management
- Catppuccin - For the beautiful color scheme
- mini.nvim - For the modular Neovim plugins
- All the open source tool maintainers
- NixOS Dotfiles - Other Nix-based dotfiles
- Awesome Nix - Curated Nix resources
Note: This configuration replaces the previous bash-script-based setup with a fully declarative Nix-based approach for better reproducibility and cross-platform support.