1 { pkgs, lib, config, nixosConfig, ... }:
4 home.activation.gnupg = lib.hm.dag.entryAfter ["writeBoundary"] ''
5 install -d -m700 ${lib.escapeShellArg config.programs.gpg.homedir}
9 enableSshSupport = true;
10 enableExtraSocket = true;
11 pinentryFlavor = lib.mkDefault (if nixosConfig.services.xserver.enable then "gtk2" else "curses");
13 programs.gpg.settings = {
14 #auto-key-locate = "keyserver";
15 auto-key-locate = false;
16 cert-digest-algo = "SHA512";
18 default-keyring = false;
19 default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 TWOFISH BZIP2 ZLIB ZIP Uncompressed";
21 fixed-list-mode = true;
22 keyid-format = "0xlong";
23 keyserver-options = "no-honor-keyserver-url";
24 personal-cipher-preferences = "AES256 AES CAST5";
25 personal-digest-preferences = "SHA512";
27 s2k-cipher-algo = "AES256";
29 s2k-digest-algo = "SHA512";
31 tofu-default-policy = "unknown";
32 trust-model = "tofu+pgp";
33 #with-fingerprint = [ true true ];
37 home.file."${config.programs.gpg.homedir}/dirmngr.conf".text = ''
39 hkp-cacert ${gnupg/keyserver.pem}
40 keyserver hkps://keys.mayfirst.org