# dotfiles > [!NOTE] > I've recently migrated this repository from > [Chezmoi](https://www.chezmoi.io/) > to > [GNU Stow](https://www.gnu.org/software/stow/). > The instructions below may be temporarily inconsistent with the new setup. > > I've used Chezmoi for this repo for three years, which has been a sufficient trial. > It's a powerful tool but I found myself learning and/or fighting with its patterns > no less than I had with Bash and Make before switching. > > Its `run_onchange_*` and related scripts encouraged me to make the whole repo a one-button machine setup/upgrade, > but I haven't been setting up machines frequently enough to get any pay off. > And when I do set up machines it's usually an ephemeral remote devbox, > meaning I don't need 90% of my dotfiles and setup scripts (e.g. App Store, casks, `rbenv`, etc.). > > This has made Stow, which is simpler and focused on piecemeal installation, > feel like a better fit. This repository holds my configuration files for macOS and Linux. It also holds a handful of install scripts that together can set up a machine, or separately can nudge a machine into the states I need it to be in. I have found this to be easier to manage than declarative tools, especially in face of various restrictions or assumptions about work machines, while not sacrificing much utility. It will work for anyone, but it is very opinionated and custom built for my own needs. ## Installation ### Prerequisites If coming from a new machine, you only need: - [Homebrew](https://brew.sh/) - [GNU Stow](https://www.gnu.org/software/stow/) - Your SSH key in GitHub #### Copy-paste Install Of Prerequisites This will install Homebrew and GNU Stow: ```sh /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" /opt/homebrew/bin/brew install stow ``` This will generate an SSH key and add it to your GitHub account: ```sh brew install gh ssh-keygen -N "" gh auth login --git-protocol ssh --hostname github.com --web ``` ### Clone & Stow ```sh mkdir -p ~/pj git clone git@github.com:glacials/dotfiles ~/pj/dotfiles cd ~/pj/dotfiles stow nvim stow tmux zsh ``` Start a new shell. After this step, future invocations of `stow` will have access to the global `.stowrc`, and therefore will not need to be run from inside `~/pj/dotfiles`. ### Updates After updating symlinked dotfiles, you can use one of these aliases (defined in `~/.zshrc`) to easily commit and push changes: ```sh dotfiles # alias for `git -C ~/pj/dotfiles` dotfiles-sync # alias for `dotfiles add -p && dotfiles commit && dotfiles pull & dotfiles push` ``` ## Caveats This project aims to be compatible with macOS and Linux; however it gets far more real-world testing on macOS, so Linux support may trip over a thing or two. ## Troubleshooting If the first run fails for some reason and later runs refuse to clone, try `rm ~/.gitconfig`, as it forces `git@github.com` over `https://github.com`, which will fail if the installation didn't yet set up SSH keys for you. ## History This started as a series of dotfiles, then a Makefile to link them, then an install script to manage installation of common tools and differences between operating systems, then a [`chezmoi`](https://github.com/twpayne/chezmoi)-powered machine bootstrapper. Today, management is handled much more simply by [GNU Stow](https://www.gnu.org/software/stow/) and machine bootstrapping is split up into a la carte shell scripts.