home: gpg: make pinentry configurable

This commit is contained in:
Bruno BELANYI 2021-04-07 17:40:11 +00:00
parent 6612d0226a
commit 5a32160954

View file

@ -3,8 +3,15 @@ let
cfg = config.my.home.gpg;
in
{
options.my.home.gpg = with lib.my; {
enable = mkDisableOption "gpg configuration";
options.my.home.gpg = with lib; {
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 {
@ -15,7 +22,7 @@ in
services.gpg-agent = {
enable = true;
enableSshSupport = true; # One agent to rule them all
pinentryFlavor = "tty";
pinentryFlavor = cfg.pinentry;
extraConfig = ''
allow-loopback-pinentry
'';