1 { pkgs, lib, config, ... }:
3 home.activation.gnupg = lib.hm.dag.entryAfter ["writeBoundary"] ''
4 install -d -m700 ${lib.escapeShellArg config.home.homeDirectory}/.gnupg
6 home.file.".gnupg/dirmngr.conf".text = ''
8 hkp-cacert ${gnupg/keyserver.pem}
9 keyserver hkps://keys.mayfirst.org
14 services.gpg-agent = {
15 enableSshSupport = true;
16 pinentryFlavor = if config.host.desktop then "gtk2" else "curses";
18 programs.gpg.settings = {
19 #auto-key-locate = "keyserver";
20 auto-key-locate = false;
21 cert-digest-algo = "SHA512";
23 default-keyring = false;
24 default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 TWOFISH BZIP2 ZLIB ZIP Uncompressed";
26 fixed-list-mode = true;
27 keyid-format = "0xlong";
28 keyserver-options = "no-honor-keyserver-url";
29 personal-cipher-preferences = "AES256 AES CAST5";
30 personal-digest-preferences = "SHA512";
32 s2k-cipher-algo = "AES256";
34 s2k-digest-algo = "SHA512";
36 tofu-default-policy = "unknown";
37 trust-model = "tofu+pgp";
38 #with-fingerprint = [ true true ];