diff --git a/services/gnupg.nix b/services/gnupg.nix index 94dfc3b..7bce4fe 100644 --- a/services/gnupg.nix +++ b/services/gnupg.nix @@ -11,20 +11,19 @@ in { programs.gnupg = { agent.enable = true; dirmngr.enable = true; - agent.pinentryPackage = pinentrySwitcher; + + agent.pinentryPackage = pkgs.pinentry-all; agent.enableSSHSupport = true; agent.enableExtraSocket = true; agent.enableBrowserSocket = true; }; + environment.interactiveShellInit = mkAfter '' + ${config.programs.gnupg.package}/bin/gpg-connect-agent --quiet updatestartuptty /bye + ''; + environment.shellInit = '' - if tty --silent; then - export GPG_TTY="$(tty)" - gpg-connect-agent /bye - export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh" - else - alias gpg=${gpgNoTTY}/bin/gpg-no-tty - fi + alias gpg=${gpgNoTTY}/bin/gpg-no-tty ''; environment.systemPackages = [