From a50f7910e6ee062dd0b5dbde6e0d3bb154b366e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Tri=C3=B1anes?= Date: Wed, 18 Sep 2024 15:38:08 +0200 Subject: [PATCH] gpg-agent: prevent nushell crashing on non-interactive sessions --- modules/services/gpg-agent.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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