1 { pkgs, lib, config, ... }:
3 nixpkgs.overlays = [ (self: super: {
4 # Avoid rebuilding graphical dependencies
5 # when using Nixpkgs PRs rebuilding them.
6 # See https://github.com/NixOS/nixpkgs/issues/96306#issuecomment-722140002
7 pinentry = super.pinentry.override {
8 enabledFlavors = [ "curses" "tty" ] ++ lib.optional config.host.desktop "gtk2";
11 home.activation.gnupg = lib.hm.dag.entryAfter ["writeBoundary"] ''
12 install -d -m700 ${lib.escapeShellArg config.home.homeDirectory}/.gnupg
14 home.file.".gnupg/dirmngr.conf".text = ''
16 hkp-cacert ${gnupg/keyserver.pem}
17 keyserver hkps://keys.mayfirst.org
22 services.gpg-agent = {
23 enableSshSupport = true;
24 pinentryFlavor = "curses";
26 programs.gpg.settings = {
27 #auto-key-locate = "keyserver";
28 auto-key-locate = false;
29 cert-digest-algo = "SHA512";
31 default-keyring = false;
32 default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 TWOFISH BZIP2 ZLIB ZIP Uncompressed";
34 fixed-list-mode = true;
35 keyid-format = "0xlong";
36 keyserver-options = "no-honor-keyserver-url";
37 personal-cipher-preferences = "AES256 AES CAST5";
38 personal-digest-preferences = "SHA512";
40 s2k-cipher-algo = "AES256";
42 s2k-digest-algo = "SHA512";
44 tofu-default-policy = "unknown";
45 trust-model = "tofu+pgp";
46 #with-fingerprint = [ true true ];