Ed Heltzel's personal configuration (.dotfiles) for MacOS using Fish shell.
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.
Zach Holman wrote a great article about dotfiles and how they are meant to be forked. I agree with this to a point... I'm more of a fan of the idea that you should take what you like and leave the rest, since dotfiles are highly personalized, and built over time so what works for me probably wont't work for you, but take inspiration all you want and make it your own.
Again, this is My personal setup – 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.
I use ssh keys to authenticate with GitHub and other services. You generally want to create new keys for each device you use, but you can also use the same key on multiple devices. I have started using two different keys for my multi-machine work flow. One key is for my personal devices and the other is for my work devices. This allows me to easily revoke access to my work devices if I discontinue a relationship with a company or customer, and not have to worry about my personal keys being compromised or having to change them.
If you look at the .gitconfig
you'll see the use of an include path = ~/.gitconfig.local
this file is created during the provisioning process and is populated with the correct configuration based on the hostname.
- Generate a new ssh keys and add to your GitHub account. - Optional
- If you want to restore your key I'd do that before moving on.
- Clone this repository
git clone [email protected]:edheltzel/dotfiles.git
- Run the
bootstrap.sh
script- Alternatively, only run the
setup.sh
scripts in specific subfolder if you don't need everything - You must start with the./packages/.setup.sh
script first. This will prevent any installation errors.
- Alternatively, only run the
- Install Fisher and Plugins -- Optional
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
fisher
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.
Generate new key and assign to global git config
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 to set up you GPG key(s).
- I found this GIST helpful
- To get VSCode setup follow this article
- Please Note if you used the Brewfile, Cask installed the macOS GPG Suite via
cask 'gpg-suite-no-mail'
-- (alternatively) update the Brewfile with `cask 'gpg-suite' to include GPGMail.
Originally I used a series of custom scripts to create symlinks, it worked but I've since switched to using GNU Stow. I feel like everything is way more manageable and easier to understand – I previously would have to review each script to make sure I wasn't going to break my system.
So with the addition of Stow, I've added a makefile to help with the process of managing each Stow package.
The following commands are available:
all
- This is the Default, the same asmake stow
stow
- Symlink all dotfiles managed by Stowunstow
- Remove all dotfiles managed by Stowupdate
- Update all dotfiles and remove broken symlinks managed by Stow
- setup.sh - Executes a long list of commands pertaining to macOS Preferences
- I can not stress enough to read this and change this for what works for you.
- DO NOT blindly run this script - it is a WIP with each macOS update things change.
- setup.sh - Symlinks all the associated rc and other dot files to your
~/
(home directory) - Special Mentions:
- setup.sh - Installs the contents of the package manager files and the Brewfile
- setup.sh - Clones the repositories in the `` files at the corresponding locations
I use NeoVim, when I need Vim. The distribution I use is LazyVim
- setup.sh - Clone LazyVim to
~/.config/nvim
- functions.sh - Contains helper functions for symlinked files and printing progress messages
Node Version switching for Node development, takes advantage of 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.
Gotta thanks to kalis.me blog post for the simple setup, and inspiration.
===
- consider dropping fisher for Plug.fish
- create a single line install script to execute bootstrap.sh
- update install.sh to include duti, packages, repos, and set local git config
- use makefile to execute bootstrap.sh and install.sh
- update README
- include Stow info
- include Make info
- include New bootstrap process
- include New install process (makefile)
- add customizations to lazyvim
- add vscode settings and symlink to dotfiles
- Look into Tuckr