Skip to content

ishchow/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

632 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Personal dotfiles.

Repo structure

.
├── 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

Supported and Tested Platforms

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

Install bootstrap dependencies

Windows

Run in admin prompt:

@('Git.Git', 'twpayne.chezmoi', 'gerardog.gsudo') | ForEach-Object { winget install --exact --id $_ --scope=machine }

Linux (OpenSUSE Tumbleweed)

sudo zypper in -y git chezmoi

OSX (HomeBrew)

# Install homebrew first
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew install git
brew install chezmoi

Initialize dotfiles

Windows

# 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

Linux/OSX

chezmoi init --apply ishchow

This will automatically setup dotfiles and bootstrap the system using POSIX shell scripts based on platform.

Change chezmoi repo settings

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

Fixing line ending errors (mostly in Windows)

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

NeoVim Bootstrap

nvim . -> all the plugins should be automatically installed.

Check LSP health

Run in command mode: :checkhealth lsp.

Copilot Bootstrap

Copilot CLI

copilot
/login

Sign in via device code flow.

Copilot LSP in NeoVim

Run in command mode :LspCopilotSignIn. Sign in via device code flow.

About

My ~ away from ~

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors