kore / home / features / cli / gpg.nix25 lines · 525B · raw
1{ pkgs, config, lib, ... }:
2
3{
4 services.gpg-agent = {
5 enable = true;
6 enableSshSupport = true;
7
8 pinentry.package = pkgs.pinentry-curses;
9 };
10
11 programs = {
12 gpg = {
13 enable = true;
14 settings.trust-model = "tofu+pgp";
15 scdaemonSettings.disable-ccid = true;
16 };
17
18 bash.initExtra = ''
19 export GPG_TTY="$(tty)"
20 export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
21 gpgconf --launch gpg-agent
22 gpg-connect-agent UPDATESTARTUPTTY /bye > /dev/null
23 '';
24 };
25}