{ pkgs, ... }: { services.udev.packages = [ pkgs.yubikey-personalization ]; environment.systemPackages = with pkgs; [ gnupg pinentry pinentry-curses pinentry-gtk2 ]; # paperkey ]; # Depending on the details of your configuration, this section might be necessary or not; # feel free to experiment environment.shellInit = '' export GPG_TTY="$(tty)" gpg-connect-agent /bye export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh" ''; programs.gnupg.agent = { enable = true; enableSSHSupport = true; pinentryFlavor = "gtk2"; }; }