Commit 0da3c8013024
Changed files (1)
systems
common
hardware
systems/common/hardware/yubikey.nix
@@ -50,12 +50,23 @@
programs.gnupg.agent.pinentryPackage = pkgs.pinentry-gnome3;
- # SSH agent with FIDO2 PIN prompt support
- # Uses NixOS's startAgent which properly sets SSH_ASKPASS in the agent's environment
+ # SSH agent with FIDO2 support
+ # Uses NixOS's startAgent which sets SSH_ASKPASS in the agent's environment.
+ # The silent askpass auto-confirms "Confirm user presence" prompts (yubikey-touch-detector
+ # already shows a desktop notification), while falling back to GTK for PIN/passphrase prompts.
programs.ssh = {
startAgent = true;
enableAskPassword = true;
- askPassword = "${pkgs.openssh-askpass}/libexec/gtk-ssh-askpass";
+ askPassword = "${
+ pkgs.writeShellScript "ssh-askpass-silent" ''
+ case "$1" in
+ *PIN*|*passphrase*|*password*)
+ exec ${pkgs.openssh-askpass}/libexec/gtk-ssh-askpass "$@"
+ ;;
+ esac
+ exit 0
+ ''
+ }";
};
# Disable GNOME's gcr-ssh-agent (conflicts with programs.ssh.startAgent)