1 { pkgs, lib, config, nixosConfig, ... }:
4 home.activation.gnupg = lib.hm.dag.entryAfter ["writeBoundary"] ''
5 install -d -m700 ${lib.escapeShellArg config.programs.gpg.homedir}
10 enableSshSupport = true;
11 enableExtraSocket = true;
12 pinentryFlavor = lib.mkDefault (if nixosConfig.services.xserver.enable then "gtk2" else "curses");
13 #pinentryPackage = lib.mkDefault (if nixosConfig.services.xserver.enable then pkgs.pinentry-gtk2 else pkgs.pinentry-curses);
15 programs.gpg.enable = true;
16 programs.gpg.settings = {
17 #auto-key-locate = "keyserver";
18 auto-key-locate = false;
19 cert-digest-algo = "SHA512";
21 default-keyring = false;
22 default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 TWOFISH BZIP2 ZLIB ZIP Uncompressed";
24 fixed-list-mode = true;
25 keyid-format = "0xlong";
26 keyserver-options = "no-honor-keyserver-url";
27 personal-cipher-preferences = "AES256 AES CAST5";
28 personal-digest-preferences = "SHA512";
30 s2k-cipher-algo = "AES256";
32 s2k-digest-algo = "SHA512";
34 tofu-default-policy = "unknown";
35 trust-model = "tofu+pgp";
36 #with-fingerprint = [ true true ];
40 home.file."${config.programs.gpg.homedir}/dirmngr.conf".text = ''
42 keyserver hkps://keys.openpgp.org
47 home.packages = lib.mkIf config.programs.gpg.enable [
48 (pkgs.pass.withExtensions (ext: with ext; [