aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjD91mZM2 <me@krake.one>2019-12-30 15:24:07 +0100
committerRobert Helgesson <robert@rycee.net>2020-01-01 13:26:21 +0100
commitebf1df58da055a0f68bc1fcc14b283791b1d191b (patch)
tree9f7065740a0ae149389ef222353b16d101db0acb
parent7c30831e8fb6449e5eaadc2a6bd5a24aff9bfd6e (diff)
gpg-agent: fix GnuPG by adding pinentry flavor option
See https://github.com/NixOS/nixpkgs/pull/71095. Fixes #908
-rw-r--r--modules/services/gpg-agent.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix
index 5dc942fef63..16a4723fea7 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
+ <literal>null</literal>, it sets
+ <option>pinentry-program</option> in
+ <filename>gpg-agent.conf</filename>. Beware that
+ <literal>pinentry-gnome3</literal> may not work on non-Gnome
+ systems. You can fix it by adding the following to your
+ system configuration:
+ <programlisting language="nix">
+ services.dbus.packages = [ pkgs.gcr ];
+ </programlisting>
+ For this reason, the default is <literal>gtk2</literal> 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 ]
);