From 9c4770af1ad15684ff58cf5941a849d949303fb0 Mon Sep 17 00:00:00 2001 From: Charles Roelli Date: Tue, 24 Feb 2026 14:00:01 +0100 Subject: Set up SSH_AUTH_SOCK with gpg-agent Some problems with the previous approach: * .bashrc only applies to bash, not e.g. Emacs * TTY configuration is not used * Ubuntu overrides SSH_AUTH_SOCK due to package gnome-keyring To make this work reliably, get rid of Ubuntu package gnome-keyring, and for good measure, libpam-gnome-keyring. --- .bashrc | 5 ----- .profile | 1 + home-configuration.scm | 3 +++ 3 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 .profile diff --git a/.bashrc b/.bashrc index e739521..5ab135a 100644 --- a/.bashrc +++ b/.bashrc @@ -116,9 +116,4 @@ if ! shopt -oq posix; then fi fi -export GPG_TTY=$(tty) -export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) -gpgconf --launch gpg-agent -gpg-connect-agent updatestartuptty /bye > /dev/null - shopt -s checkjobs diff --git a/.profile b/.profile new file mode 100644 index 0000000..11dd1da --- /dev/null +++ b/.profile @@ -0,0 +1 @@ +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) diff --git a/home-configuration.scm b/home-configuration.scm index 5e05df8..f88fe76 100644 --- a/home-configuration.scm +++ b/home-configuration.scm @@ -23,6 +23,9 @@ (list (simple-service 'home-environment-variables-service home-environment-variables-service-type '(("EDITOR" . "emacsclient"))) + (simple-service 'additional-profile-config + home-shell-profile-service-type + (list (local-file ".profile" "profile"))) (service home-bash-service-type (home-bash-configuration (aliases '(("egrep" . "egrep --color=auto") -- cgit v1.3