home: gpg: make it enable-able

This commit is contained in:
Bruno BELANYI 2021-03-13 00:01:29 +00:00
parent 2732d0558a
commit 58c9b60722

View file

@ -1,15 +1,24 @@
{ ... }:
{ config, lib, ... }:
let
cfg = config.my.home.gpg;
in
{
programs.gpg = {
enable = true;
options.my.home.gpg = with lib.my; {
enable = mkDisableOption "gpg configuration";
};
services.gpg-agent = {
enable = true;
enableSshSupport = true; # One agent to rule them all
pinentryFlavor = "tty";
extraConfig = ''
allow-loopback-pinentry
'';
config = lib.mkIf cfg.enable {
programs.gpg = {
enable = true;
};
services.gpg-agent = {
enable = true;
enableSshSupport = true; # One agent to rule them all
pinentryFlavor = "tty";
extraConfig = ''
allow-loopback-pinentry
'';
};
};
}