Skip to content
d4vucatPublic

About

Personal dev environment — managed with chezmoi

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

Personal dev environment — managed with chezmoi.

Stack: Bash · VS Code
Environment: WSL2 Ubuntu + Windows
Tools: nvm · pyenv · Miniconda · EDB PostgreSQL 17 + PostGIS · Memurai


Quick start

New machine — Windows side first

# Run as Administrator in PowerShell
Set-ExecutionPolicy Bypass -Scope Process -Force
powershell -File windows\windows-setup.ps1

Installs: Memurai (Redis), VS Code, JetBrainsMono Nerd Font, .wslconfig

WSL2 Ubuntu

# One-liner bootstrap (no dotfiles needed yet)
bash <(curl -fsSL https://raw.githubusercontent.com/NgoHuuLoc0612/dotfiles/main/scripts/bootstrap.sh)

# Or clone first
git clone https://github.com/YOUR_GITHUB/dotfiles ~/.local/share/chezmoi
bash ~/.local/share/chezmoi/scripts/bootstrap.sh

Bootstrap installs:

  • nvm + Node LTS, pnpm, tsx, typescript
  • pyenv + Python 3.12, ruff, black, uv
  • Miniconda (base not auto-activated)
  • Rust + cargo
  • EDB PostgreSQL 17 + PostGIS (native, no Docker)
  • fzf, ripgrep, bat, eza, delta, starship
  • chezmoi, gh CLI
  • JetBrainsMono Nerd Font

Apply dotfiles

chezmoi init --apply https://github.com/NgoHuuLoc0612/dotfiles
exec bash

Structure

dotfiles/
├── home/                     # Mapped to $HOME by chezmoi
│   ├── dot_bashrc            # → ~/.bashrc
│   ├── dot_bash_profile      # → ~/.bash_profile
│   ├── dot_gitignore_global  # → ~/.gitignore_global
│   └── dot_config/
│       ├── git/
│       │   └── config.tmpl   # → ~/.config/git/config (templated)
│       ├── vscode_settings.json    # copy to VS Code manually or via script
│       └── vscode_extensions.txt  # install via: xargs code --install-extension
├── scripts/
│   └── bootstrap.sh          # Full dev environment setup
├── windows/
│   └── windows-setup.ps1     # Memurai, fonts, .wslconfig, VS Code extensions
├── docs/
└── .chezmoi.toml.tmpl        # chezmoi config template

Day-to-day chezmoi usage

# Add a file to chezmoi
chezmoi add ~/.bashrc

# Edit a managed file
chezmoi edit ~/.bashrc

# See what would change
chezmoi diff

# Apply changes
chezmoi apply

# Pull + apply from remote
chezmoi update

# Push changes to git
cd ~/.local/share/chezmoi && git push

Aliases (defined in .bashrc):

cm    → chezmoi
cma   → chezmoi add
cmu   → chezmoi update
cmd   → chezmoi diff
cmap  → chezmoi apply
dotfiles → cd ~/.local/share/chezmoi

VS Code settings

# Linux/WSL2
cp ~/.local/share/chezmoi/home/dot_config/vscode_settings.json \
   ~/.config/Code/User/settings.json

# Install extensions
cat ~/.local/share/chezmoi/home/dot_config/vscode_extensions.txt \
  | grep -v '^#' | grep -v '^$' \
  | xargs -L1 code --install-extension

Secrets

Secrets are encrypted with age via chezmoi.

# Generate key (first time)
age-keygen -o ~/.config/chezmoi/key.txt

# Add an encrypted secret
chezmoi add --encrypt ~/.ssh/id_ed25519

# The encrypted file is stored safely in the repo

WSL2 connection cheatsheet

Service From WSL2 From Windows
PostgreSQL psql -U postgres (local socket) localhost:5432
Memurai redis-cli -h $WSL_HOST_IP localhost:6379
Dev server http://localhost:PORT http://localhost:PORT (mirrored networking)

.wslconfig uses networkingMode=mirrored — ports are shared automatically.

About

Personal dev environment — managed with chezmoi

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages