24 lines
554 B
Nix
24 lines
554 B
Nix
|
{
|
||
|
config,
|
||
|
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";
|
||
|
};
|
||
|
}
|