This is my personal configuration (.dotfiles) for macOS that involves web development and devops which are deployed using GNU Stow. There are also files for provisioning a new machine and setting up my environment β they are highly personalized and built over time, so what works for me probably won't work for you. But take inspiration all you want and make it your own. So proceed with caution, and use at your own risk.
Caveats for non-Apple Silicon (Intel)
If you are on any version of macOS that uses AFPS, you'll need to disable the SIP. First check to see if SIP is enabled or not.csrutil status
output should read:
System Integrity Protection status: enabled.
If your SIP is enabled, then follow the next steps to disable it β Assuming that you know what you're doing, here is how to turn off System Integrity Protection on your Mac.
- Turn off your Mac (Apple > Shut Down).
- Hold down Command-R and press the Power button. Keep holding Command-R until the Apple logo appears.
- Wait for OS X to boot into the OS X Utilities window.
- Choose Utilities > Terminal.
- Enter csrutil disable.
- Enter reboot.
csrutil status
-> should readSystem Integrity Protection status: disabled.
Since we have a bad habit of forgetting things:
- Install Xcode Command Line Tools
sudo softwardupdate -i -a && xcode-select --install
- This will install
git
andmake
if not already installed.
- This will install
- Setup SSH keys for GitHub
- Generate a new ssh keys or restore existing key if needed.
- Clone this repository to
~/.dotfiles
- Run the
bootstrap.sh
script ormake install
command
Originally I used a series of custom scripts to create symlinks, it worked but I've since switched to using GNU Stow. This is way more manageable and easier to understand.
So with the addition of Stow, I added a makefile
β I treat this like NPM scripts. You need to be in the root of ~/.dotfiles
to execute any of the make
commands.
The following commands are available:
help Show this help message (default)
install Bootstraps a new machine
run Symlink all dotfiles w/Stow
stow Add individual packages w/Stow
unstow Remove individual packages w/Stow
delete Delete all dotfiles w/Stow
update Sync & clean dead symlinks w/Stow
make install
task, it will execute thebootstrap.sh
script. This script will install the necessary package managers, packages with dependencies, applications, clone the necessary repositories, configure the~/.gitconfig.local
and symlink dotfiles using Stow.
There are two options for managing packages with Stow:
- Just use Stow:
stow nvim
orstow -D nvim
(unstow) - Use the Makefile:
make stow pkg=nvim
ormake unstow pkg=nvim
- The
pkg=
variable must be specified.
- The
- dots (dots/)
- misc dotfiles that are stored in the $HOME directory
- git (git/)
- git configuration
- fish (fish/)
- XDG Base Directory β Reference: XDG Base Directory for more information. To edit/set the XDG Base Directory variables, you can edit the
~/fish/.config/fish/conf.d/paths.fish
file. Hopefully, this will keep the$HOME
directory clean and organized.
- XDG Base Directory β Reference: XDG Base Directory for more information. To edit/set the XDG Base Directory variables, you can edit the
- nvim (nvim/)
- When I need Vim, I use LazyVim - lightly customized.
- config (config/)
- Configuration files for various applications
- local (local/)
- User specific data not configuration related. ie: fonts, wallpapers, misc items that mean nothing,etc.
- warp (warp/)
- I like Warp but I really like iTerm2
- vscode (vscode/)
- I use the sync feature in vscode to keep my settings and extensions in sync. The
settings.json
andkeybindings.json
are symlinked out of habit.
- I use the sync feature in vscode to keep my settings and extensions in sync. The
Any of the scripts can be run individually at any time to update/reset as needed.
macos.sh
- Executes a long list of commands pertaining to macOS Preferences β DO NOT blindly run this script - it is a WIP with each macOS update things change.
packages.sh
- Installs the Brewfile and each package manager's packages based on the.txt
files.
repos.sh
- Clones the repositories in the `` files at the corresponding locations
private.sh
- Left empty on purpose
duti.sh
- Sets the default applications for file types- run
./duti/duti.sh
to reset the default applications for file types
- run
There isn't anything of substance in the misc/
directory, it's just a place to store files that don't fit anywhere else and I like to keep handy.
functions.sh
- Contains helper functions for symlinked files and printing progress messages
Fish: Fisher Plugin Manager
In the past, Fisher (fish plugin manager) will do something weird or will introduce a breaking change - just reinstall Fisher.curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
Node Development
Node Version switching for Node development, takes advantage of [fnm](https://github.com/Schniz/fnm) for managing Node versions, which supports both `.nvmrc` and `.node-version` files.- Install happens in the
Brewfile
by running
brew install fnm
For Completions run:
fnm completions --shell fish
Make sure you run:
./fish/./setup.sh
This will symlink the fnm.fish
file in ~/.config/fish/conf.d
(It might be helpful to source ~/.config/fish/config.fish
)
Note: FNM has the ability to auto switch Node versions if there is a .node-version
or .nvmrc
file - this is enabled by default
# automatically run fnm use
fnm env --use-on-cd | source
Please note that when you change your default Node version, you will need to run
npm install --global (cat node_packages.txt)
to includecorepack
in the global packages. This will ensure thatpnpm
andyarn
are available.
Git: Commit and Tag Signing
SSH Signing
I use SSH commit signing over GPG. GPG is there if I need it, but I prefer SSH. For a few resources to help get this setup:
The .gitconfig
includes .gitconfig.local
[meta]
isLocalConfig = true
[user]
signingkey = PATH_TO_YOUR_KEY
[gpg "ssh"]
allowedSignersFile = PATH_TO_YOUR_ALLOWED_SIGNERS_FILE
If you choose to use this make sure you look at that ./git/git.sh
, this script is where the provisioning of .gitconfig.local
happens.
GPG Commit Signing - optional
GPG signing is set to `TRUE` by default. If you rather not enable GPG then execute: `git config --global commit.gpgsign false` and remove the GPG packages from the [Brewfile](https://github.com/edheltzel/dotfiles/blob/master/packages/Brewfile).
[renew expired gpg](https://gist.github.com/krisleech/760213ed287ea9da85521c7c9aac1df0)
[Generate new key and assign to global git config](https://gist.github.com/paolocarrasco/18ca8fe6e63490ae1be23e84a7039374#:~:text=It%20means%20that%20is%20not,secret%20keys%20available%20in%20GPG.)
main take away:
- `gpg --list-secret-keys --keyid-format=long`
- Copy key
- set key for your git user
- `git config --global user.signingkey <your key>`
- If you need help setting this up GPG:
- follow the Github article for [Signing Commits](https://help.github.com/en/articles/signing-commits) to set up you GPG key(s).
- I found this [GIST helpful](https://gist.github.com/cezaraugusto/2c91d141ddec026753051ffcace3f1f2)
- To get VSCode setup follow this [article](https://dev.to/devmount/signed-git-commits-in-vs-code-36do)
- **Please Note** if you used the [Brewfile](https://github.com/edheltzel/dotfiles/blob/master/packages/Brewfile), Cask installed the macOS [GPG Suite](https://gpgtools.org/) via `cask 'gpg-suite-no-mail'` -- _(alternatively)_ update the [Brewfile](https://github.com/edheltzel/dotfiles/blob/master/packages/Brewfile) with `cask 'gpg-suite' to include GPGMail.
Gotta thanks to kalis.me blog post for the simple setup, and inspiration.
===
- create a single line install script to execute bootstrap.sh
- use makefile to execute bootstrap.sh and install.sh
- Look into Tuckr
- update make unstow to include only the available stow package or all
- add customizations to lazyvim
- add vscode settings and symlink to dotfiles
- add XDG Base Directory support
- update README
- include XDG info
- include Stow info
- include Make info
- include New bootstrap process
- include New install process (makefile)