Improve ssh-with-yubikey alias

This commit is contained in:
Lauren Lagarde 2025-07-15 21:21:23 -05:00
parent ba98bec371
commit 9bfca72823

View file

@ -2,7 +2,10 @@
programs.bash = {
enable = true;
shellAliases = {
ssh-with-yubikey = "ssh -A -R \"$(gpgconf --list-dirs agent-socket):$(gpgconf --list-dirs agent-socket)\" -o \"StreamLocalBindUnlink=yes\"";
ssh-with-yubikey = "ssh_with_yubikey";
};
bashrcExtra = ''
ssh_with_yubikey () { AGENT_SOCKET=$(ssh $@ gpgconf --list-dirs agent-socket) && ssh -A -R "$AGENT_SOCKET:$(gpgconf --list-dirs agent-socket)" -o "StreamLocalBindUnlink=yes" $@; }
'';
};
}