Maintained with https://chezmoi.io
TLDR: skip to Installationπ
Getting a new machine up and running with all the tools you use (shells, editors, version control) can be consuming and error prone. Not to mention keeping up with new versions and breaking changes... Chezmoi tracks your personal configuration files (dotfiles like ~/.zshrc
) in git, and allows you to quickly restore your settings on any new or existing machine. It also allows common project configurations to be shared and updated across teams.
Read more about chezmoi here: What does chezmoi do?, Quick Start Guide, User Guide.
- Installs Homebrew and bundles your Brewfile πΊ
- Installs and configures pkgx, the new package manager from the creator of Homebrew, to replace the need for
rvm
,rbenv
,asdf
,fvm
, etc. - Generates your SSH keypair and uploads your public key to your GitHub account
- Installs VSCode and the best extensions
- Configures starship cross-shell prompt as your default prompt π
- Opt-in LazyVim configuration for vim users π€
Finally, it installs the kitty terminalπ± and configures your zsh
shell to look and function like this:
Of course, all these settings are totally customizable. But this dotfiles
repo serves as a great starting point.
- OS X
command-line-tools
installed (or a fullXCode
installation) git
installed and a GitHub account.
Note
Opening a terminal and running git -v
should walk you through the
process of installing xcode command line tools (if not already installed).
Otherwise run xcode-select --install
.
- Finally, if you have other package managers (such as
rvm
,rbenv
orasdf
) installed, they may conflict withpkgx
. The install script will take care of removing them, but just remember not to reinstall them or things may break in unexpected ways π£
Important
RVM is very invasive, so after uninstalling with rvm implode
, you may need to logout and login to OS X to disable RVM's cd
shell hooks π
Some linux support already in place, but not tested.
sh -c "$(curl -fsLS get.chezmoi.io)" -- -b $HOME/bin init --apply pgumeson-fabric
Note
If something goes wrong during the installation, simply re-run the above command.
Chezmoi will prompt you for a few things, like your email address for git commits and your preferred text editor (VSCode
, Neovim
, etc.). It will then walk you through all the installation steps and use those saved configs to setup everything customized for you.
When you're finished, all you have to do is open a new kitty
terminal and your new .zshrc will be loaded with your settings. π±
Important
If on chezmoi's first run, the installation detects that you have files in your home directory that would be overwritten,
you will be prompted to back them up to your ~/.dotfilebackups
directory. That way you can always restore specific files,
or go all the way back to the way things were.
Note
During the initial installation you will be guided through the process of generationg your SSH keypair and uploading the public key to your GitHub account.
This will not overwrite or affect any existing SSH keys you currently have!
However, if you current SSH key uses an older encryption method like rsa
insted of ed25519
, then you should delete your older keys from your GitHub account. π
Important
Of course it will use your user
and laptop
name for the public key title, not mine π
With pkgx, simply run the dev
command to let pkgx know the current directory is a project. It will try to figure out all the dependencies based on the contents of the directory. You can also create a file called pkgx.yaml
to explicitly define dependencies to be instsalled and ENV
variables to be set.
Note
Pkgx packages are only installed to your path for the current project! π
See: https://docs.pkgx.sh/using-dev/dev
Once the installer has finished running, chezmoi
will be in your PATH and you can run commands like chezmoi update -v
, which will pull down the latest changes from git and apply them to your home directory. Chezmoi is fully idempotent, so it will only install new packages or apply updates that have changed since your last run.
If you want to make modifications to your configs then the typical workflow looks like this:
$ cd ~
$ chezmoi edit .zshrc
$ chezmoi apply # to apply your changes to your home dir
Then once you are happy with your changes:
chezmoi cd # cd into your dotfiles git directory
git add dot_zshrc.tmpl
git commit
Note
If you only need to make small changes, then you shouldn't need to commit anything at all. In fact, it's fine to just use the customization hooks below. That way you can easily pull down upstream changes and improvements without branching or forking.
For any large customizations you can simply modify your local dotfiles repo at ~/.local/share/chezmoi
(and then ideally submit bug-fix PRs and improvement PRs back upstream). But if you only require small local changes (like adding zsh aliases
or tweaking your prompt), we provide some customization hooks.
These hooks are just local files in your home directory that live outside the chezmoi repo, but still get run at specific times when you open a new terminal.
So instead of putting shell customizations in ~/.zshrc
(which is managed by chezmoi), favor adding them in ~/.zlogin
. By default, zsh will source .zlogin
right after ~/.zshrc
, making it the perfect place to add any aliases or zsh customizations that are specific only to you. For example:
touch ~/.zlogin
code ~/.zlogin
Read more in the Hooks README.mdπͺ
Let me know if you are interested in submitting PRs and I'll add you as a contributor. π€
- Backup home directory on first run
- Customization hooks πͺ
- Auto-clone our projects to local projects dir and configure
- Sunset asdf once pkgx supports all the package versions we're using
- Fish shell support π
- Opt-in React tools and environment
- Opt-in Flutter tools and environment π¦
- Secure retreival of files from passowrd manager π
- LazyVim config π€
- Opt-in for Emacs editor