nixos-dotfiles/modules/ssh/yubikey.nix

21 lines
572 B
Nix
Raw Normal View History

{ 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";
};
}