From fd9403cf925c3a446ae5546e8cafb6de8a6ccbe7 Mon Sep 17 00:00:00 2001 From: Patrick Kissling Date: Thu, 7 Nov 2024 08:29:46 +0100 Subject: [PATCH] Create profile specific ssh configuration --- ssh/config | 1 + ssh/config_private | 1 + ssh/config_work | 1 + ssh/install.sh | 1 + zsh/.zshrc | 2 +- zsh/install.sh | 2 +- 6 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 ssh/config_private create mode 100644 ssh/config_work diff --git a/ssh/config b/ssh/config index a2ade61..1b2f512 100644 --- a/ssh/config +++ b/ssh/config @@ -1,4 +1,5 @@ Include ~/.orbstack/ssh/config +Include ~/.ssh/config_profile_specific Host * UseKeychain yes diff --git a/ssh/config_private b/ssh/config_private new file mode 100644 index 0000000..1bb8bf6 --- /dev/null +++ b/ssh/config_private @@ -0,0 +1 @@ +# empty diff --git a/ssh/config_work b/ssh/config_work new file mode 100644 index 0000000..50abb47 --- /dev/null +++ b/ssh/config_work @@ -0,0 +1 @@ +Include ~/Coding/work/operations/terraform/ssh_config.d/* diff --git a/ssh/install.sh b/ssh/install.sh index abf20a0..43dc6e6 100755 --- a/ssh/install.sh +++ b/ssh/install.sh @@ -15,6 +15,7 @@ ln -sfv "${HOME}"/.ssh/"${USAGE}".priv "${HOME}"/.ssh/id_rsa # create symlinks for config file ln -sfv "${HOME}"/dotfiles/ssh/config "${HOME}"/.ssh +ln -sfv "${HOME}"/dotfiles/ssh/config_"${USAGE}" "${HOME}"/.ssh/config_profile_specific # add private ssh key from 1password, if not exist # shellcheck disable=SC2140 diff --git a/zsh/.zshrc b/zsh/.zshrc index 3affc7b..c43a74f 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -105,4 +105,4 @@ alias vi="nvim" alias vim="nvim" # source usage specific configuration -source ~/.zshrc_user +source ~/.zshrc_profile_specific diff --git a/zsh/install.sh b/zsh/install.sh index c3f2651..13f94d2 100755 --- a/zsh/install.sh +++ b/zsh/install.sh @@ -4,7 +4,7 @@ USAGE=$(cat "${HOME}"/dotfiles/.profile) # create symlinks ln -sfv "${HOME}"/dotfiles/zsh/.zshrc "${HOME}" -ln -sfv "${HOME}"/dotfiles/zsh/.zshrc_"${USAGE}" "${HOME}"/.zshrc_user +ln -sfv "${HOME}"/dotfiles/zsh/.zshrc_"${USAGE}" "${HOME}"/.zshrc_profile_specific # install zsh, if not installed already if [ -z "${ZSH}" ] || ! [ -d "${ZSH}" ]; then