console: enable ssh-agent

This commit is contained in:
Pavel Korytov 2025-01-23 12:16:22 +03:00
parent 8ac7ebc54a
commit 02fd51a72b
2 changed files with 22 additions and 0 deletions

View file

@ -50,6 +50,15 @@ if [ -d "$HOME/.guix-extra-profiles" ] ; then
fi
# SSL Certs:1 ends here
# [[file:Console.org::*ssh-agent][ssh-agent:1]]
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent -t 1h > "$XDG_RUNTIME_DIR/ssh-agent.env"
fi
if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
fi
# ssh-agent:1 ends here
# [[file:Console.org::*Guix settings][Guix settings:1]]
if [ -z "$IS_ANDROID" ] && [ -z "$NO_GUIX" ] ; then
GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles

View file

@ -103,6 +103,19 @@ if [ -d "$HOME/.guix-extra-profiles" ] ; then
export CURL_CA_BUNDLE="$SSL_CERT_FILE"
fi
#+end_src
** ssh-agent
I'm paranoid so I encrypt my SSH keys.
Got the idea for below from [[https://wiki.archlinux.org/title/SSH_keys#SSH_agents][ArchWiki]]:
#+begin_src bash
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent -t 1h > "$XDG_RUNTIME_DIR/ssh-agent.env"
fi
if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
fi
#+end_src
** Guix settings
Enable extra profiles