Yubikey: Difference between revisions

imported>SuperSandro2000
Add note about 22.11
imported>SuperSandro2000
Remove settings no longer relevant for 22.11
Line 7: Line 7:
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
services.udev.packages = [ pkgs.yubikey-personalization ];
services.udev.packages = [ pkgs.yubikey-personalization ];
# Depending on the details of your configuration, this section might not be necessary
# on NixOS 22.11 setting this is no longer required because it is already done by the gnupg module
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 = {
programs.gnupg.agent = {
Line 20: Line 12:
   enableSSHSupport = true;
   enableSSHSupport = true;
};
};
</syntaxHighlight>
If you don't have a graphical user interface, you'll have to adjust the pinentry program (it's the program launched by operating system to ask for YubiKey's PIN):
<syntaxHighlight lang=nix>
programs.gnupg.agent.pinentryFlavor = "curses";
</syntaxHighlight>
</syntaxHighlight>