home: gpg: make pinentry configurable

This commit is contained in:
Bruno BELANYI 2021-04-07 17:40:11 +00:00
parent 2dbb25a9e3
commit f96bc19bf6

View file

@ -3,8 +3,15 @@ let
cfg = config.my.home.gpg; cfg = config.my.home.gpg;
in in
{ {
options.my.home.gpg = with lib.my; { options.my.home.gpg = with lib; {
enable = mkDisableOption "gpg configuration"; enable = my.mkDisableOption "gpg configuration";
pinentry = mkOption {
type = types.str;
default = "tty";
example = "gtk2";
description = "Which pinentry interface to use";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -15,7 +22,7 @@ in
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; # One agent to rule them all enableSshSupport = true; # One agent to rule them all
pinentryFlavor = "tty"; pinentryFlavor = cfg.pinentry;
extraConfig = '' extraConfig = ''
allow-loopback-pinentry allow-loopback-pinentry
''; '';