From eea1bc607249f0b79fb437b5e9709aa6d2218bac Mon Sep 17 00:00:00 2001 From: DrymarchonShaun <40149778+DrymarchonShaun@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:15:43 -0700 Subject: [PATCH] gpg-agent: use $TTY parameter in zsh integration --- modules/services/gpg-agent.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index 7af58c8df..8bfe68aae 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -18,6 +18,10 @@ let export GPG_TTY '' + optionalString cfg.enableSshSupport gpgSshSupportStr; + gpgZshInitStr = '' + export GPG_TTY=$TTY + '' + optionalString cfg.enableSshSupport gpgSshSupportStr; + gpgFishInitStr = '' set -gx GPG_TTY (tty) '' + optionalString cfg.enableSshSupport gpgSshSupportStr; @@ -287,7 +291,7 @@ in { ''; programs.bash.initExtra = mkIf cfg.enableBashIntegration gpgInitStr; - programs.zsh.initExtra = mkIf cfg.enableZshIntegration gpgInitStr; + programs.zsh.initExtra = mkIf cfg.enableZshIntegration gpgZshInitStr; programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration gpgFishInitStr;