summary refs log blame commit diff stats
path: root/hm/gpg/default.nix
blob: aecb4d473abf329d6cf1f718cc51c64e9fef7656 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
 
       

      
                  

                        
                                
                                           
                            
                                                           
    

                                               
                                                         
     

                               
 
{
  pkgs,
  lib,
  ...
}: {
  programs.gpg = {
    enable = true;
  };
  services.gpg-agent = {
    enable = true;
    defaultCacheTtl = 60 * 5;
    defaultCacheTtlSsh = 60 * 5;
    pinentryPackage = pkgs.pinentry-curses;
    enableSshSupport = true;
    sshKeys = ["4077454831C98FE4BE4A9C167186C5A63615B790"];
  };
  programs.zsh.initExtraFirst = lib.mkBefore ''
    current_tty="$(tty)"
    tty() { echo "$current_tty"; }
    SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
    gpg-connect-agent /bye
  '';
  home.sessionVariables = {
    GNUPGHOME = lib.mkForce "";
  };
}