mirror of
https://github.com/d0zingcat/dotfiles.git
synced 2026-05-13 15:09:34 +00:00
feat: 1Password SSH agent auto-setup and SSH config template
- Add 1Password SSH agent socket symlink creation in setup.sh - Copy ssh/example template to ~/.ssh/config on fresh install - Update Brewfile with additional packages (bun, pnpm, qq, teamviewer, etc.) - Update documentation (CHECKLIST, MIGRATION_GUIDE, README)
This commit is contained in:
46
setup.sh
46
setup.sh
@@ -191,6 +191,28 @@ function cmd_install() {
|
||||
mkdir -p "$HOME_DIR/.config"
|
||||
mkdir -p "$HOME_DIR/.ssh"
|
||||
mkdir -p "$HOME_DIR/.kube"
|
||||
mkdir -p "$HOME_DIR/.1password"
|
||||
|
||||
local op_agent_target="$HOME_DIR/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
|
||||
local op_agent_link="$HOME_DIR/.1password/agent.sock"
|
||||
if [ -S "$op_agent_target" ]; then
|
||||
if [ -L "$op_agent_link" ]; then
|
||||
local op_link_target
|
||||
op_link_target=$(readlink "$op_agent_link")
|
||||
if [ "$op_link_target" = "$op_agent_target" ]; then
|
||||
print_success "1Password SSH agent link already exists"
|
||||
else
|
||||
print_warning "~/.1password/agent.sock points elsewhere; leaving it unchanged"
|
||||
fi
|
||||
elif [ -e "$op_agent_link" ]; then
|
||||
print_warning "~/.1password/agent.sock already exists; leaving it unchanged"
|
||||
else
|
||||
ln -s "$op_agent_target" "$op_agent_link"
|
||||
print_success "Linked 1Password SSH agent"
|
||||
fi
|
||||
else
|
||||
print_warning "1Password SSH agent socket not found yet"
|
||||
fi
|
||||
|
||||
# Link files
|
||||
print_warning "Linking files..."
|
||||
@@ -228,6 +250,28 @@ function cmd_install() {
|
||||
print_warning "Not found: $from"
|
||||
fi
|
||||
done
|
||||
|
||||
# Install SSH config from template without symlinking it into the repo.
|
||||
local ssh_template="$WORKING_DIR/ssh/example"
|
||||
local ssh_target="$HOME_DIR/.ssh/config"
|
||||
if [ -f "$ssh_template" ]; then
|
||||
if [ -L "$ssh_target" ]; then
|
||||
local ssh_link_target
|
||||
ssh_link_target=$(readlink "$ssh_target")
|
||||
if [ "$ssh_link_target" = "$WORKING_DIR/ssh/config" ] || [ "$ssh_link_target" = "$ssh_template" ]; then
|
||||
rm "$ssh_target"
|
||||
cp "$ssh_template" "$ssh_target"
|
||||
print_success "Copied SSH config from template"
|
||||
else
|
||||
print_warning "~/.ssh/config is a custom symlink; leaving it unchanged"
|
||||
fi
|
||||
elif [ -f "$ssh_target" ]; then
|
||||
print_warning "~/.ssh/config already exists; leaving it unchanged"
|
||||
else
|
||||
cp "$ssh_template" "$ssh_target"
|
||||
print_success "Copied SSH config from template"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Initialize git config excludesfile
|
||||
print_warning "Configuring git..."
|
||||
@@ -518,6 +562,8 @@ function cmd_full_recover() {
|
||||
echo " git config --file ~/.gitconfig user.email 'your@email.com'"
|
||||
echo " git config --file ~/.gitconfig user.signingkey 'your-ssh-key'"
|
||||
echo ""
|
||||
echo " # SSH config template is in ~/.dotfiles/ssh/example"
|
||||
echo " # 1Password SSH agent symlink should exist at ~/.1password/agent.sock"
|
||||
echo " # Generate new SSH keys"
|
||||
echo " ssh-keygen -t ed25519 -C 'your@email.com'"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user