From 76adba6741e1fedc5510056a9c349dff6d9295c6 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Mon, 1 May 2023 12:06:16 +0200 Subject: [PATCH] Restructure systemd services definition. Add environment variables --- home-manager.nix | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/home-manager.nix b/home-manager.nix index 58cbe26..4489d1e 100644 --- a/home-manager.nix +++ b/home-manager.nix @@ -54,20 +54,28 @@ in ./home-manager/fish.nix ]; - systemd.user.services = { - ssh-agent = { - Unit = { - Description = "SSH key agent"; - }; - Service = { - Type = "simple"; - Environment = "SSH_AUTH_SOCK=%t/ssh-agent.socket"; - ExecStart = "/run/current-system/sw/bin/ssh-agent -D -a $SSH_AUTH_SOCK"; - }; - Install = { - WantedBy = [ "default.target" ]; + systemd.user = { + # user services + services = { + # ssh-agent user service + ssh-agent = { + Unit = { + Description = "SSH key agent"; + }; + Service = { + Type = "simple"; + Environment = "SSH_AUTH_SOCK=%t/ssh-agent.socket"; + ExecStart = "/run/current-system/sw/bin/ssh-agent -D -a $SSH_AUTH_SOCK"; + }; + Install = { + WantedBy = [ "default.target" ]; + }; }; }; + # user environment variables + sessionVariables = { + SSH_AUTH_SOCK = "/run/user/1000/ssh-agent.socket"; + }; }; services.mako.enable = true;