Skip to content
/ dotfiles Public

macOS / Linux / Codespaces compatible dotfiles with 1-line setup script. Tested on Apple Silicon Macs. Supports both zsh and fish. Managed with Chezmoi

License

Notifications You must be signed in to change notification settings

narze/dotfiles

 
 

Repository files navigation

Dotfiles

Bootstrap my macOS machines, for fun & profit. Now supports Github Codespaces!

Dotfiles are meant to be forked, but mine isn't. This script installs many things you won't use.

Usage

git clone https://github.com/narze/dotfiles ~/dotfiles
cd ~/dotfiles && make bootstrap

# Optional : Change to SSH url for pushing updates
git remote set-url origin [email protected]:narze/dotfiles.git

Zsh + Fish

After the recent drama with Zinit, I decided to give Fish a try, it is good but I also want to still maintain my Zsh configuration. I migrated the settings to zsh4human which is maintained by the one who made Powerlevel10k. It's 2-3x faster than Zinit as of now.

I'll separate the dotfiles script to install zsh or fish separately to save some space. You also install both like mine.

Apple Silicon

Here are the list of issues I've found on running the script on M1 Macbooks (Tested on both Macbook Air & Macbook Pro)

  • dotbot/brew fails silently : Now they need XCode to be installed first (via App Store), rather than just XCode CLT Seems to be fixed now

  • Kitty.app installing binaries from Homebrew does get you x86, now you have to Build from source

    • ghq get -l kovidgoyal/kitty
      /opt/homebrew/bin/python3 setup.py kitty.app # Needs python3 from brew
      cp -r kitty.app /Applications/kitty.app
      
      # Replace CLI
      rm /opt/homebrew/bin/kitty
      ln -s $PWD/kitty/launcher/kitty /opt/homebrew/bin/kitty
    • If you want both versions, download the executable and rename it (kitty_x86.app)

  • Docker for Mac : Replace with Tech Preview version

  • Some brew/asdf packages cannot be installed on arm64 See "Apple Silicon specific commands"

  • Setup both versions of Homebrew, then use shell script to point to the correct brew

    # Install both versions
    arch -arm64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
    # .zshrc
    if [ "$(uname -m)" == "arm64" ]; then
      # Use arm64 brew, with fallback to x86 brew
      if [ -f /opt/homebrew/bin/brew ]; then
        export PATH="/usr/local/bin${PATH+:$PATH}";
        eval $(/opt/homebrew/bin/brew shellenv)
      fi
    else
      # Use x86 brew, with fallback to arm64 brew
      if [ -f /usr/local/bin/brew ]; then
        export PATH="/opt/homebrew/bin${PATH+:$PATH}";
        eval $(/usr/local/bin/brew shellenv)
      fi
    fi
  • Rubygems : Specific bundler config is needed (See bundle config)

  • Yabai : Cannot use space switch commands (eg. yabai -m space --focus 1) even if SIP is disabled

    Workaround

    Setup native shortcut keys manually and use non-consuming shortcut settings (->) in skhd image

Apple Silicon specific commands

  • make brew-x86 : Install packages which cannot be instaled with arm64 arch right now (eg. kubectl, kubectx Both are now supported!)

Manual tasks (One-time per machine)

  • Login to App Store before running make brew (It runs mas which needs App Store permission.)
  • Preferences -> Change input source switch to CMD+Space, and Spotlight search to Option+Space
  • asdf needs shell reloading once after installation. Run setup command make asdf once, open a new terminal, then run make asdf again.
  • Run mackup restore once after Syncthing is installed and ~/Sync/Mackup is synced.
  • Connect to Zerotier private network to mount NAS
  • Setup Arq for backup
  • Disable Boom 3D Keyboard Shortcuts
  • Disable Timing Shortcut

Features

$ make
help                           Print command list
bootstrap                      Bootstrap new machine
dotfiles                       Update dotfiles
macos                          Run macos script
code                           Clone Repositories with ghq
brew                           Install brew & cask packages
brew-light                     Install light version of brewfile (Minimal)
brew-x86                       Install x86-compatible Homebrew packages (Expected to Apple Silicon Macs)
tools                          Install non-brew tools eg. tmux package manager
asdf                           Install asdf-vm
sync                           Sync local configuration from Google Drive, Dropbox, etc.
update                         Update everything
vim                            Setup vim
all                            Run all tasks at once

Installed Applications & Tools

About

macOS / Linux / Codespaces compatible dotfiles with 1-line setup script. Tested on Apple Silicon Macs. Supports both zsh and fish. Managed with Chezmoi

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published