diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index 1d015397c..03affd217 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -6,6 +6,12 @@ let cfg = config.services.gpg-agent; + gpgInitStr = '' + GPG_TTY="$(tty)" + export GPG_TTY + gpg-connect-agent updatestartuptty /bye > /dev/null + ''; + in { @@ -44,11 +50,8 @@ in SSH_AUTH_SOCK = "\${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh"; }; - programs.bash.initExtra = '' - GPG_TTY="$(tty)" - export GPG_TTY - gpg-connect-agent updatestartuptty /bye > /dev/null - ''; + programs.bash.initExtra = gpgInitStr; + programs.zsh.initExtra = gpgInitStr; } # The systemd units below are direct translations of the