diff --git a/home-manager/programs/bash.nix b/home-manager/programs/bash.nix index 2ae8bde..89f39ad 100644 --- a/home-manager/programs/bash.nix +++ b/home-manager/programs/bash.nix @@ -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" $@; } + ''; }; }