From ddf158c389c7dbb7156e5a76f25098b682baf308 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Fri, 5 May 2023 12:33:33 +0200 Subject: [PATCH] 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 --- nixos-config/home-manager.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos-config/home-manager.nix b/nixos-config/home-manager.nix index bdc8f342..2f43cda2 100644 --- a/nixos-config/home-manager.nix +++ b/nixos-config/home-manager.nix @@ -71,7 +71,7 @@ in Service = { Type = "simple"; 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 = { WantedBy = [ "default.target" ]; @@ -80,7 +80,7 @@ in }; # user environment variables sessionVariables = { - SSH_AUTH_SOCK = "/run/user/1000/ssh-agent.socket"; + SSH_AUTH_SOCK = "${builtins.getEnv"XDG_RUNTIME_DIR"}/ssh-agent.socket"; }; };