diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index 8bfe68aae..ccdcb6163 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -27,7 +27,9 @@ let '' + optionalString cfg.enableSshSupport gpgSshSupportStr; gpgNushellInitStr = '' - $env.GPG_TTY = (tty) + if (is-terminal --stdin) { + $env.GPG_TTY = (tty) + } '' + optionalString cfg.enableSshSupport '' ${gpgPkg}/bin/gpg-connect-agent updatestartuptty /bye | ignore