dotfiles

My dotfiles 🥑

Stars
19
Committers
1

Dotfiles 🥑

Installation

These instructions are to be followed when installing these dotfiles on a new machine. Do these steps:

  1. XCode: If running on a Mac, you need part of XCode. You don't need the whole XCode. Open the terminal and run

    xcode-select --install
    

    which will prompt the installer.

  2. Homebrew.

    1. Install it following the website's instructions.

    2. Export its path (only for now):

      export PATH="/opt/homebrew/bin:$PATH"
      
  3. Git: ensure you have git installed (it's present by default on macOS).

  4. zsh: these days, zsh is the default shell on macOS. Cool, but double check by opening up a terminal and running echo $0, which should print -zsh.

    Now do these:

    • delete /etc/zprofile

    • remove path_helper-related lines from /etc/profile

    • make sure /etc/paths contains this:

      /usr/bin
      /bin
      /usr/sbin
      /sbin
      

    These slow things down and mess up with $PATH.

  5. Ensure you have the $DOTFILES environment variable set. For example:

    export DOTFILES="$HOME/dotfiles"
    
  6. Copy SSH keys from 1Password (after doing mkdir ~/.ssh), into ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub.

  7. Clone the dotfiles and run the setup script:

    git clone https://github.com/whatyouhide/dotfiles.git "$DOTFILES"
    cd "$DOTFILES"
    ./setup
    
  8. asdf: you're using asdf installed via Homebrew. Add this to ~/.zshenv-extra:

    echo "\nsource $(brew --prefix asdf)/libexec/asdf.sh" >> ~/.zshenv.extra
    

GitHub

  1. Authenticate to GitHub by doing:

    gh auth login
    

    GitHub takes care of the whole flow for you, by redirecting you to a browser to do the authentication.

  2. Now that you have 1Password, log in as necessary and enable the SSH agent.

  3. Generate a new SSH key for this computer and add it to your GitHub account.

    ssh-keygen -t ed25519 -C <email>
    
  4. Add the newly-generated key to 1Password.

  5. Set up GPG signing of commits through 1Password. When you create the new entry in 1Password, it should automatically suggest to use 1Password for signing commits. It'll tell you to modify ~/.gitconfig, so follow the instructions. If you still want to use GPG, see this file. For this to work, you also need to add the key as a signing key in GitHub (guide).