Skyler Grey | e5084c5 | 2024-07-21 12:27:18 +0000 | [diff] [blame] | 1 | { 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 | } |