diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index b2122219..dfd4b89c 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -89,7 +89,10 @@ in home.sessionVariables = optionalAttrs cfg.enableSshSupport { - SSH_AUTH_SOCK = "\${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh"; + SSH_AUTH_SOCK = + if config.home.sessionVariableSetter == "pam" + then "\${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh" + else "$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)"; }; programs.bash.initExtra = gpgInitStr;