]> Git — Sourcephile - julm/julm-nix.git/blob - home-manager/profiles/gnupg.nix
julm: blackberry: mpv: limit cache-secs
[julm/julm-nix.git] / home-manager / profiles / gnupg.nix
1 { pkgs, lib, config, nixosConfig, ... }:
2 {
3 /*
4 home.activation.gnupg = lib.hm.dag.entryAfter ["writeBoundary"] ''
5 install -d -m700 ${lib.escapeShellArg config.programs.gpg.homedir}
6 '';
7 */
8 services.gpg-agent = {
9 enable = true;
10 enableSshSupport = true;
11 enableExtraSocket = true;
12 pinentryPackage = lib.mkDefault (if nixosConfig.services.xserver.enable then pkgs.pinentry-gtk2 else pkgs.pinentry-curses);
13 };
14 programs.gpg.enable = true;
15 programs.gpg.settings = {
16 #auto-key-locate = "keyserver";
17 auto-key-locate = false;
18 cert-digest-algo = "SHA512";
19 charset = "utf-8";
20 default-keyring = false;
21 default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 TWOFISH BZIP2 ZLIB ZIP Uncompressed";
22 emit-version = false;
23 fixed-list-mode = true;
24 keyid-format = "0xlong";
25 keyserver-options = "no-honor-keyserver-url";
26 personal-cipher-preferences = "AES256 AES CAST5";
27 personal-digest-preferences = "SHA512";
28 quiet = true;
29 s2k-cipher-algo = "AES256";
30 s2k-count = "65536";
31 s2k-digest-algo = "SHA512";
32 s2k-mode = "3";
33 tofu-default-policy = "unknown";
34 trust-model = "tofu+pgp";
35 #with-fingerprint = [ true true ];
36 use-agent = true;
37 utf8-strings = true;
38 };
39 home.file."${config.programs.gpg.homedir}/dirmngr.conf".text = ''
40 allow-ocsp
41 keyserver hkps://keys.openpgp.org
42 #use-tor
43 #log-file dirmngr.log
44 #standard-resolver
45 '';
46 home.packages = lib.mkIf config.programs.gpg.enable [
47 (pkgs.pass.withExtensions (ext: with ext; [
48 pass-audit
49 pass-checkup
50 #pass-file
51 pass-genphrase
52 pass-import
53 pass-otp
54 pass-tomb
55 pass-update
56 ]))
57 ];
58 }