The question is basically this (How do I get ssh-agent to work in all terminals?) but for NixOS.
The only NixOS option I could find was
security.pam.services.<name>.sshAgentAuth but this may not be it because it didn’t work (or I didn’t use it correctly; maybe re-boot needed?).
I tried to use
keychain as well (with these instructions) but no luck; any new terminal would just ignore it. (Again, this still could be me.)
Is there a straightforward post on how to do this? Thanks in advance!
update-1: Also found
/nixos/modules/programs/ssh.nix in Nixpkgs that seems to start
ssh-agent as a service, but not sure what I’m looking at to be honest.
The relevant option in my case would probably be
Whether to start the OpenSSH agent when you log in. The OpenSSH agent remembers private keys for you so that you don’t have to type in passphrases every time you make an SSH connection. Use
ssh-addto add a key to the agent.
Added it to
nixos-rebuild switch, and it does not work but that’s probably because I haven’t logged in and out yet.
So what is
security.pam.services.<name>.sshAgentAuth used for then?