Skip to content

Instantly share code, notes, and snippets.

@waltfy
Last active March 5, 2024 10:48
Show Gist options
  • Save waltfy/e8364aa6bec25ff4c708765d08f4e20e to your computer and use it in GitHub Desktop.
Save waltfy/e8364aa6bec25ff4c708765d08f4e20e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -x
# make sure we install macOS command line tools
if ! xcode-select -p &> /dev/null
then
xcode-select --install
fi
# make sure we install brew
if ! command -v brew &> /dev/null
then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew tap "homebrew/cask-versions"
brew install --cask "1password/tap/1password-cli"
brew install --cask "1password-beta"
brew install chezmoi gpg
mkdir -p ~/.ssh
cat << EOF > ~/.ssh/config
Host *
AddKeysToAgent yes
IgnoreUnknown UseKeychain
UseKeychain yes
IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
EOF
# restart ssh-agent
eval "$(ssh-agent -s)" | awk '{print $3}' | xargs kill -9
curl -L 'https://drive.usercontent.google.com/u/0/uc?id=18J-avaAMcKpFGTjQKIeYTno7lvN6O2G2&export=download' | gpg --decrypt --no-symkey-cache --pinentry loopback
cat << EOF
Now you can run:
eval \$(op signin)
Then, finally:
chezmoi init [email protected]:waltfy/dotfiles.git
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment