Skip to content

jeremy-code/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jeremy-code/dotfiles

License Last Commit

This is my dotfiles repository. There are many like it, but this one is mine.

Intended to be a mainly macOS (but also GNU/Linux-compatible) development environment for coding in JavaScript, TypeScript, Python, and other languages with various other tools, configurations, and plugins for convenience and productivity.

Features

Installation

Using a chezmoi-first approach:

/bin/sh -c "$(curl -fsLS get.chezmoi.io)" -- -b $HOME/.local/bin init --apply jeremy-code
brew install chezmoi --adopt

Or with a Homebrew-first approach (see run_once_install_00-homebrew.sh for more details):

# Install Homebrew with either the signed-.pkg file at Homebrew's GitHub
# releases https://github.com/Homebrew/brew/releases/latest or run the script
# from https://github.com/Homebrew/install using:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew install chezmoi
chezmoi init jeremy-code --apply

Ideally, inspect either shell script before running them to ensure they are safe to run. This will be the easiest attack vector since afterwards, packages installed in homebrew-core will be verified using cryptographic attestations of build provenance since $HOMEBREW_VERIFY_ATTESTATIONS is enabled in home/dot_config/homebrew/brew.env.tmpl (see Homebrew for more details).

Configuration

chezmoi

chezmoi is used to manage the dotfiles in this repository. The source directory is the $HOME/.local/share/chezmoi/home directory (declared in .chezmoiroot) and the destination directory is correspondingly the user's home directory or $HOME. The other configuration files are stored in the source directory, such as home/.chezmoiexternal.toml.

Additional root scripts are located in the home/.chezmoiscripts directory. These scripts are intended to be indempotent (can be run multiple times without altering the whole system). Since chezmoi runs scripts in ASCII-defined order, the scripts are prefixed with a two-digit number XX- to define the order in which they are run if it is relevant, a convention used commonly in Debian-based systems using run-parts or those inspired by Unix System V's init design (see Debian/sysvinit).

Homebrew

Homebrew is used to install Homebrew formulae and casks, Mac App Store apps, and Visual Studio Code extensions. Configuration is stored in the home/dot_config/homebrew directory.

  • The brew bundle dependencies are defined in the Brewfile file
  • When the aforementioned file is updated, brew bundle install is automatically ran with the script run_once_after_Brewfile.sh.tmpl
  • The brew.env.tmpl file defines additional Homebrew environment variables ($HOMEBREW_*)

iTerm2

The configuration of iTerm2 is defined mainly in home/Library/Application Support/iTerm2. The dynamic profile DynamicProfiles/profiles.json has custom color schemes, theming, and other settings. The directory also contains the Scripts directory for custom scripts to be used in iTerm2, such as Scripts/AutoLaunch/change_default_profile.py which sets the default profile to the aforementioned dynamic profile on launch.

Some additional configuration is installed in home/.chezmoiscripts/run_once_40-mac.sh.tmpl to set non-profile settings.

Visual Studio Code

The configuration files of Visual Studio Code are stored in home/Library/Application Support/Code and contains custom settings User/settings.json, keybindings User/keybindings.json, and code snippets User/snippets/*.json. It uses the One Dark Pro Darker theme, Fira Code font, and Material Icon Theme. It also sets up various extensions for programming languages or library tooling (Prettier and ESLint, etc.) in addition to miscellaneous utilities such as Git Blame, carbon-now-sh, etc.

zsh and Oh My Zsh

The default shell is zsh using the framework Oh My Zsh. The base zsh configuration files home/dot_zshrc and home/dot_zprofile configure Oh My Zsh and set up some necessary startup environment variables respectively. Shell scripts attempt to follow the Google Shell Style Guide as closely as possible.

Additional .sh shell scripts are stored in home/dot_config/oh-my-zsh directory (the $ZSH_CUSTOM directory) which contains:

  • aliases.zsh - Enables custom command aliases, suffix aliases (.zip, .git), and named directories (~github and ~dotfiles)
  • constants.zsh - Sets custom constants for the shell environment
  • telemetry.zsh - Sets environment variables to disable telemetry and analytics for various applications

Furthermore, this directory contains a functions directory for additional functions for zsh that are autoloaded in the aforementioned home/dot_zprofile.tmpl file.

The plugins git and colored-man-pages are bundled with Oh My Zsh and are enabled in the .zshrc file. Additionally, the external plugins zsh-users/zsh-autosuggestions, zsh-users/zsh-history-substring-search, zsh-users/zsh-syntax-highlighting are installed to the corresponding $ZSH_CUSTOM/plugins directory. These external plugins along Oh My Zsh are defined in home/.chezmoiexternal.toml as external Git repositories to be installed by chezmoi.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

My dotfiles using Chezmoi, Homebrew, and Oh My Zsh

Resources

License

Stars

Watchers

Forks