gnupg.nix 712 B

12345678910111213141516171819202122232425262728293031323334
  1. { config, lib, pkgs, ... }:
  2. let
  3. configHome = "${config.xdg.configHome}/gnupg";
  4. in
  5. {
  6. home.sessionVariables = {
  7. GNUPGHOME = configHome;
  8. };
  9. programs.gpg = {
  10. enable = true;
  11. homedir = configHome;
  12. publicKeys = [{
  13. source = pkgs.fetchurl {
  14. url = "https://keys.openpgp.org/vks/v1/by-fingerprint/7A53D4C6B481F7711588D34FDE749C31D060A160";
  15. sha256 = "c4I7c+mZVOJpm54aOhIJQtAXAhBQZPnyp4LHEzuH09w=";
  16. };
  17. trust = 5;
  18. }];
  19. };
  20. services.gpg-agent = {
  21. enable = lib.mkDefault true;
  22. defaultCacheTtl = 600;
  23. maxCacheTtl = 7200;
  24. enableExtraSocket = true;
  25. enableSshSupport = true;
  26. extraConfig = ''
  27. keep-tty
  28. keep-display
  29. '';
  30. };
  31. }