{ config, main, ... }: { programs.gpg = { enable = true; homedir = "${config.xdg.dataHome}/gnupg"; scdaemonSettings = { disable-ccid = true; }; }; services.gpg-agent = { enable = true; pinentryFlavor = (if main.services.xserver.enable then "qt" else "curses"); extraConfig = '' allow-emacs-pinentry allow-loopback-pinentry ''; }; }