niksos/hosts/niks/ssh/ssh-agent.nix
2023-09-08 16:10:15 +02:00

22 lines
542 B
Nix

{
pkgs,
...
}: {
systemd.user.services.ssh-agent = {
enable = true;
description = "SSH key agent";
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.openssh}/bin/ssh-agent -D -a $SSH_AUTH_SOCK";
};
environment = {
SSH_AUTH_SOCK = "%t/ssh-agent.socket";
DISPLAY = ":0";
};
wantedBy = [ "default.target" ];
};
environment.sessionVariables = {
SSH_AUTH_SOCK = "\$XDG_RUNTIME_DIR/ssh-agent.socket";
};
}