summaryrefslogtreecommitdiff
path: root/home/environ/gpg.nix
blob: dd58181e951756bef77b4cf43fc9f37e8f7895b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ config, lib, pkgs, ... }:
with lib; let
  cfg = config.local.environ;
in
{
  config = mkIf cfg.enable {
    programs.gpg = {
      enable = true;
      scdaemonSettings.disable-ccid = true;
    };

    services.gpg-agent = {
      enable = true;

      enableBashIntegration = true;
      enableZshIntegration = true;

      enableExtraSocket = true;
      enableSshSupport = true;

      defaultCacheTtl = 3600 * 3;
      defaultCacheTtlSsh = 3600 * 3;

      maxCacheTtl = 3600 * 6;
      maxCacheTtlSsh = 3600 * 6;

      pinentryPackage = pkgs.pinentry-gtk2;
    };
  };
}