Skip to content
/ dotfiles Public template

My setup for 🐠 Fish shell on  macOS - v3

Notifications You must be signed in to change notification settings

edheltzel/dotfiles

Repository files navigation

dotfiles logo

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.

So what's next?

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.

⚙️ Usage and the Install

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.

  1. Turn off your Mac (Apple > Shut Down).
  2. Hold down Command-R and press the Power button. Keep holding Command-R until the Apple logo appears.
  3. Wait for OS X to boot into the OS X Utilities window.
  4. Choose Utilities > Terminal.
  5. Enter csrutil disable.
  6. Enter reboot.
  7. csrutil status -> should read System Integrity Protection status: disabled.

SSH Keys

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.

  1. 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.
  1. Clone this repository
git clone [email protected]:edheltzel/dotfiles.git
  1. Run the bootstrap.sh script
    1. 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.
  2. Install Fisher and Plugins -- Optional
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
fisher

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.

renew expired gpg

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:
  • 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.

GNU Stow

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.

Makefile

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 as make stow
  • stow - Symlink all dotfiles managed by Stow
  • unstow - Remove all dotfiles managed by Stow
  • update - Update all dotfiles and remove broken symlinks managed by Stow

macOS Preferences (macos/)

  • 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.

Misc Dotfiles (misc/)

  • setup.sh - Symlinks all the associated rc and other dot files to your ~/ (home directory)
  • Special Mentions:
    • .tigrc - tig – configured with pretty colors and layout for git diff and logs
    • .eslintrc - has specific configuration for my JS workflow
    • bat/config - bat – a clone of cat with syntax highlighting

Packages (packages/)

  • setup.sh - Installs the contents of the package manager files and the Brewfile

Repositories (repos/)

  • setup.sh - Clones the repositories in the `` files at the corresponding locations

Vim (nvim/)

I use NeoVim, when I need Vim. The distribution I use is LazyVim

  • setup.sh - Clone LazyVim to ~/.config/nvim

Helper Scripts (scripts/)

  • functions.sh - Contains helper functions for symlinked files and printing progress messages

Node development

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 include corepack in the global packages. This will ensure that pnpm and yarn are available.

🙏 Special Thanks

Gotta thanks to kalis.me blog post for the simple setup, and inspiration.

===

📝 TODOs

  • 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