{ pkgs, config, lib, ... }: with lib; let cfg = config.erwin.gpg; in { options.erwin.gpg = { enable = mkOption { description = "Enable GPG"; type = types.bool; default = false; }; }; config = mkIf (cfg.enable) { home.packages = with pkgs; [ pinentry-curses ]; programs.gpg = { enable = true; }; services.gpg-agent = { enable = true; pinentryFlavor = "curses"; enableSshSupport = true; defaultCacheTtlSsh = 14400; maxCacheTtlSsh = 14400; }; }; }