{ config, lib, pkgs, ... }:

with lib;
let
  cfg = config.modules.software.tools.gpg;
in {
  options.modules.software.tools.gpg = {
    enable = mkEnableOption "Enable gnupg, an open pgp software";
  };

  config = mkIf cfg.enable {
    hm.programs.gpg.enable = true;
    hm.services.gpg-agent = {
      enable = true;
      enableExtraSocket = true;
      enableSshSupport = true;

      pinentryPackage = pkgs.pinentry-gnome3;
    };
  };
}