Use variables where possible
Path to openssh package is accessed using ${pkgs.openssh} Variable for ssh socket is set based on the built in XDG_RUNTIME_DIR variable
This commit is contained in:
parent
8a42523a9f
commit
ddf158c389
@ -71,7 +71,7 @@ in
|
|||||||
Service = {
|
Service = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
Environment = "SSH_AUTH_SOCK=%t/ssh-agent.socket";
|
Environment = "SSH_AUTH_SOCK=%t/ssh-agent.socket";
|
||||||
ExecStart = "/run/current-system/sw/bin/ssh-agent -D -a $SSH_AUTH_SOCK";
|
ExecStart = "${pkgs.openssh}/bin/ssh-agent -D -a $SSH_AUTH_SOCK";
|
||||||
};
|
};
|
||||||
Install = {
|
Install = {
|
||||||
WantedBy = [ "default.target" ];
|
WantedBy = [ "default.target" ];
|
||||||
@ -80,7 +80,7 @@ in
|
|||||||
};
|
};
|
||||||
# user environment variables
|
# user environment variables
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
SSH_AUTH_SOCK = "/run/user/1000/ssh-agent.socket";
|
SSH_AUTH_SOCK = "${builtins.getEnv"XDG_RUNTIME_DIR"}/ssh-agent.socket";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user