Skip to content

tothlp/dotfiles

Repository files navigation

tothlp's dotfiles

🌱 dotfiles, managed by chezmoi. 🏠

This repo holds some configuration files for my current setup, which are managed by chezmoi across multiple workstations and Codespaces.

🔧 Automated Installation

Install chezmoi first, and pull configs from this repo.

sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply tothlp

Apply the configs. Note, that before applying the configs, it will run the init scripts located in .chezmoiscripts folder. It will install Xcode command line tools, and homebrew for us. Afterwards, chezmois applies the configs.

chezmois apply

After applying the configs, the .chezmoiscripts/run_once_after_00_install-packages-from-brewfile.sh.tmpl script runs brew bundle, and installs dependencies from Brewfile.

🔧 Manual Installation

First of all, we need to install git, which is packed in Xcode command line tools.

sudo softwareupdate -i -a
xcode-select --install

Next, we will need Homebrew. The installation below is copied from the Homebrew official site.

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

Install chezmoi, and init it from this repo.

brew install chezmoi
chezmoi init --apply tothlp

Apply the config files

chezmoi -v apply

At last, install the packages from Brewfile.

brew bundle

☀️ Day-to-day usage

Recreate Brewfile if needed

brew bundle dump --force

Add it to chezmoi, so Git can notice changes

chezmoi add Brewfile

We can also edit the chezmoi-managed files directly

chezmoi edit ~/.zshrc

See the diff, apply changes

chezmoi diff
chezmoi apply -v

After that, we can change into chezmoi's directory, and review changes, push to git, etc

chezmoi cd

Additional resources

Official chezmoi repository

chezmoi site