From 937225bbfbd608107e881d7bb56c0c30950a4393 Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Sat, 25 May 2024 13:40:43 +0200 Subject: [PATCH] [GnuPG] fix Pinentry support, use pinentry-all package by default Also remove now redundant shell init code (already done in upstream module) --- services/gnupg.nix | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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 = [