{ config, lib, pkgs, ... }: with lib; let cfg = config.local.environ; in { config = mkIf cfg.enable { programs.gpg = { enable = true; scdaemonSettings.disable-ccid = true; }; services.gpg-agent = { enable = true; enableBashIntegration = true; enableZshIntegration = true; enableExtraSocket = true; enableSshSupport = true; defaultCacheTtl = 3600 * 3; defaultCacheTtlSsh = 3600 * 3; maxCacheTtl = 3600 * 6; maxCacheTtlSsh = 3600 * 6; pinentryPackage = pkgs.pinentry-gtk2; }; }; }