{ config
, pkgs
, ...
}: {
  programs.gpg = {
    enable = true;
    homedir = "${config.xdg.dataHome}/gnupg";
    settings = {
      keyserver = "hkps://keys.openpgp.org";
    };
  };
  services.gpg-agent = {
    enable = true;
    pinentryPackage = with pkgs;
      if stdenv.isDarwin
      then pinentry_mac
      else pinentry-qt;
  };
}