infra/nix/home-manager/programs/gpg-agent.nix

33 lines
625 B
Nix

{
lib,
pkgs,
config,
...
}: {
home.packages =
[
pkgs.gcr
]
++ (
if config.services.gpg-agent.pinentryFlavor == "gtk2"
then [pkgs.pinentry-gtk2]
else if config.services.gpg-agent.pinentryFlavor == "gnome3"
then [pkgs.pinentry-gnome]
else []
);
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
enableScDaemon = true;
enableSshSupport = true;
grabKeyboardAndMouse = true;
pinentryFlavor = lib.mkDefault "gtk2";
extraConfig = ''
no-allow-external-cache
'';
defaultCacheTtl = 0;
maxCacheTtl = 0;
};
}