helm/modules/shell/gnupg.nix
2019-12-05 00:32:29 -05:00

31 lines
611 B
Nix

{ config, lib, pkgs, ... }:
{
environment = {
extraInit = ''
export GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
mkdir -p "$GNUPGHOME" -m 700
'';
systemPackages = with pkgs; [
gnupg
pinentry
];
};
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
systemd.user.services.gpg-agent.serviceConfig.ExecStart = [
"" ''
${pkgs.gnupg}/bin/gpg-agent \
--supervised \
--allow-emacs-pinentry \
--default-cache-ttl 1200 \
--pinentry-program ${pkgs.pinentry}/bin/pinentry-gtk-2
''
];
}