blob: 28eb5e6689f04a4ef55f3df47815e355362088ef [file] [log] [blame]
Skyler Greye5084c52024-07-21 12:27:18 +00001{ pkgs
2, ...
3}: {
4 services.ssh-agent.enable = true;
5
6 systemd.user.services.ssh-agent-add = {
7 Unit = {
8 Description = "Automatically add ssh keys to the ssh-agent";
9 After = "ssh-agent.service";
10 Requires = "ssh-agent.service";
11 };
12
13 Service = {
14 Type = "oneshot";
15 ExecStart = "${pkgs.bash}/bin/sh -c 'SSH_AUTH_SOCK=%t/ssh-agent ${pkgs.openssh}/bin/ssh-add'";
16 };
17
18 Install.WantedBy = [ "default.target" ];
19 };
20}