Personal dotfiles.
.
├── bootstrap # Contains data used for bootstrapping new systems
├── chezmoi_home # Contains dotfiles that are managed by chezmoi (https://www.chezmoi.io/)
├── home # Contains dotfiles that are not managed by chezmoi (typically these are symlinked using setup scripts)
├── misc # Contains anything that doesn't cleanly fit into the other folders
These are the platforms that this repo is used to manage and tested with:
- Windows 11 or above
- Linux
- Scipts to install packages and instructions on bootstrapping only support OpenSUSE Tumbleweed
- But the rest of the config works fine on any Linux system (theoretically, not tested)
- MacOS
- Apple Silicon
- Techincally can work on Intel Mac but some paths may be hardcoded to Apple Silico paths
- Sequoia or above
- Apple Silicon
Run in admin prompt:
@('Git.Git', 'twpayne.chezmoi', 'gerardog.gsudo') | ForEach-Object { winget install --exact --id $_ --scope=machine }
sudo zypper in -y git chezmoi
# Install homebrew first
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install git
brew install chezmoi
# Setup necessary configs on system to run bootstrap scripts
sudo config --enable normal
Set-ExecutionPolicy -ExecutionPolicy Bypass
# First, init the dotfiles but do not run any scripts
chezmoi init --apply ishchow --exclude=scripts
# Then, do bootstrap that mostly needs to run as admin.
# .chezmoiscripts are pain when script needs to run as admin.
# So managing these scripts separately.
# We don't run the entire script as Admin as some child scripts fail when run as Admin.
# So parent script will invoke child scripts needing Admin using sudo.
pwsh.exe -File $(Resolve-Path ~/AppData/Local/ishaat/bootstrap/000_bootstrap.ps1).Path
# Finally, this will init dotfiles again and then run scripts
chezmoi init --apply ishchow
chezmoi init --apply ishchow
This will automatically setup dotfiles and bootstrap the system using POSIX shell scripts based on platform.
chezmoi cd
# In case default git user is different
git config user.email "<chezmoi repo email>"
# set remote URL to https to avoid potential SSH login for fetch/pull since repo is public
git config remote.origin.url https://github.com/ishchow/dotfiles.git
# Check if ssh to github works
ssh -T git@github.com
# If so, update chezmoi repo url for pushes only.
git remote set-url --push origin git@github.com:ishchow/dotfiles.git
Might get errors like this in Windows (seems to happen when I'm copying from ChatGPT):
PS C:\Users\ischowdh\.local\share\chezmoi> git add -A
fatal: CRLF would be replaced by LF in chezmoi_home/AppData/Local/ishaat/bootstrap/005_stop_mssqlserver.ps1.tmpl
To fix do this:
# enter WSL
wsl
# Convert file to LF line endings, repeat similar command for all offending files
dos2unix chezmoi_home/AppData/Local/ishaat/bootstrap/005_stop_mssqlserver.ps1.tmpl
# exit WSL
exit
# should work now
git add -A
nvim . -> all the plugins should be automatically installed.
Run in command mode: :checkhealth lsp.
copilot
/login
Sign in via device code flow.
Run in command mode :LspCopilotSignIn. Sign in via device code flow.