{ config, lib, pkgs, ... }: let cfg = config.nixfiles.modules.gnupg; in { options.nixfiles.modules.gnupg = { enable = lib.mkEnableOption "GnuPG"; pinentry = lib.mkOption { description = "Name of a pinentry implementation."; type = lib.types.package; default = pkgs.pinentry-curses; }; }; config = lib.mkIf cfg.enable { hm = { programs.gpg = { enable = true; homedir = "${config.dirs.data}/gnupg"; settings = { armor = true; keyid-format = "long"; no-greeting = true; no-random-seed-file = true; with-fingerprint = false; with-keygrip = false; }; }; services.gpg-agent = { enable = true; pinentryPackage = cfg.pinentry; }; }; }; }