From ebf1df58da055a0f68bc1fcc14b283791b1d191b Mon Sep 17 00:00:00 2001 From: jD91mZM2 Date: Mon, 30 Dec 2019 15:24:07 +0100 Subject: [PATCH] gpg-agent: fix GnuPG by adding pinentry flavor option See https://github.com/NixOS/nixpkgs/pull/71095. Fixes #908 --- modules/services/gpg-agent.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index 5dc942fef..16a4723fe 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -129,6 +129,26 @@ in configuration file. ''; }; + + pinentryFlavor = mkOption { + type = types.nullOr (types.enum pkgs.pinentry.flavors); + example = "gnome3"; + default = "gtk2"; + description = '' + Which pinentry interface to use. If not + null, it sets + in + gpg-agent.conf. Beware that + pinentry-gnome3 may not work on non-Gnome + systems. You can fix it by adding the following to your + system configuration: + + services.dbus.packages = [ pkgs.gcr ]; + + For this reason, the default is gtk2 for + now. + ''; + }; }; }; @@ -153,6 +173,9 @@ in optional (cfg.maxCacheTtlSsh != null) "max-cache-ttl-ssh ${toString cfg.maxCacheTtlSsh}" ++ + optional (cfg.pinentryFlavor != null) + "pinentry-program ${pkgs.pinentry.${cfg.pinentryFlavor}}/bin/pinentry" + ++ [ cfg.extraConfig ] );