{ pkgs, lib, config, ... }: let cfg = config.py.programs.gpg; in { options.py.programs.gpg.enable = lib.mkEnableOption "gpg"; config.programs.gpg = lib.mkIf cfg.enable { enable = true; settings = { personal-cipher-preferences = "AES256 AES192 AES"; personal-digest-preferences = "SHA512 SHA384 SHA256"; personal-compress-preferences = "ZLIB BZIP2 ZIP Uncompressed"; default-preference-list = "SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed"; cert-digest-algo = "SHA512"; s2k-digest-algo = "SHA512"; s2k-cipher-algo = "AES256"; charset = "utf-8"; fixed-list-mode = true; no-comments = true; no-emit-version = true; no-greeting = true; keyid-format = "0xlong"; list-options = "show-uid-validity"; verify-options = "show-uid-validity"; with-fingerprint = true; with-key-origin = true; require-cross-certification = true; no-symkey-cache = true; use-agent = true; throw-keyids = true; default-key = "0xFE1D8A7D620C611F"; trusted-key = "0xFE1D8A7D620C611F"; keyserver = "hkps://keys.openpgp.org"; }; scdaemonSettings = { card-timeout = "60"; pcsc-shared = true; # shared-access = true; disable-ccid = true; pcsc-driver = "${pkgs.pcsclite.out}/lib/libpcsclite.so"; reader-port = "Yubico Yubi"; }; }; }