blob: 28eb5e6689f04a4ef55f3df47815e355362088ef [file] [log] [blame]
{ pkgs
, ...
}: {
services.ssh-agent.enable = true;
systemd.user.services.ssh-agent-add = {
Unit = {
Description = "Automatically add ssh keys to the ssh-agent";
After = "ssh-agent.service";
Requires = "ssh-agent.service";
};
Service = {
Type = "oneshot";
ExecStart = "${pkgs.bash}/bin/sh -c 'SSH_AUTH_SOCK=%t/ssh-agent ${pkgs.openssh}/bin/ssh-add'";
};
Install.WantedBy = [ "default.target" ];
};
}