aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpablu <me@pablu.de>2026-09-19 00:34:38 +0200
committerpablu <me@pablu.de>2026-09-19 00:34:38 +0200
commitcc71d9cad6fe60fb3e3ad2f9d84e9f733ad097c6 (patch)
treea8552103469af9a1827547c711f020dae79d87ec
parentf8312a59c775c740d9af173fafa65ab7e731e03e (diff)
use gnupg as ssh-agent
-rw-r--r--dot_gnupg/private_gpg-agent.conf9
-rw-r--r--dot_zshrc.tmpl6
2 files changed, 15 insertions, 0 deletions
diff --git a/dot_gnupg/private_gpg-agent.conf b/dot_gnupg/private_gpg-agent.conf
new file mode 100644
index 0000000..888afb5
--- /dev/null
+++ b/dot_gnupg/private_gpg-agent.conf
@@ -0,0 +1,9 @@
+# Use gpg-agent as the single persistent SSH authentication agent.
+enable-ssh-support
+
+# Cache SSH-key passphrases for a working day, but require them again at
+# least once every 24 hours.
+default-cache-ttl-ssh 28800
+max-cache-ttl-ssh 86400
+
+pinentry-program /usr/bin/pinentry
diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl
index 7ca280e..489b539 100644
--- a/dot_zshrc.tmpl
+++ b/dot_zshrc.tmpl
@@ -47,6 +47,12 @@ alias ls='eza --icons=always'
{{ if eq .chezmoi.hostname "gentoo" }}
+unset SSH_AGENT_PID
+export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
+export GPG_TTY="$(tty)"
+gpgconf --launch gpg-agent
+gpg-connect-agent updatestartuptty /bye >/dev/null
+
eval "$(mise activate zsh)"
[[ -r ~/.config/secrets/openrouter.env ]] && source ~/.config/secrets/openrouter.env