From dd087379d9b895499e96bce56bba3cbad81d2f0e Mon Sep 17 00:00:00 2001 From: Anthony Oteri <4360016+anthonyoteri@users.noreply.github.com> Date: Thu, 18 Sep 2025 07:56:33 -0400 Subject: [PATCH] feat: use gpg-agent for ssh-agent --- .profile | 6 ++++++ .zshrc | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 .profile diff --git a/.profile b/.profile new file mode 100644 index 0000000..5cb981f --- /dev/null +++ b/.profile @@ -0,0 +1,6 @@ +# Start the gpg-agent if not already running +if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then + gpg-connect-agent /bye >/dev/null 2>&1 +fi + +alias gpg-unlock "gpg-connect-agent updatestartuptty /bye" diff --git a/.zshrc b/.zshrc index 2fb465a..ffc98bf 100644 --- a/.zshrc +++ b/.zshrc @@ -92,6 +92,10 @@ export PATH=${HOME}/.local/bin:${HOME}/.cargo/bin:${HOME}/go/bin:${PATH} export MONOREPO_ROOT=${HOME}/Projects/monorepo export DOCKER_BUILDKIT=1 +# Export SSH_AUTH_SOCK to GPG eo enable using gpgagent as the ssh-agent +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) +gpgconf --launch gpg-agent + # Custom aliases alias cat='bat ' alias vim=$(which nvim)