From 1fb4a2ec9c8dc2dea824501df6925a3667db32e3 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Thu, 30 Jan 2025 15:05:48 +0100 Subject: [PATCH] services/ssh: add keys to agent automatically --- modules/services/ssh.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/services/ssh.nix b/modules/services/ssh.nix index 6c910f5..b63c4ab 100644 --- a/modules/services/ssh.nix +++ b/modules/services/ssh.nix @@ -2,10 +2,20 @@ lib, config, ... -}: { +}: let + inherit (config.local.systemVars) username; +in { config = lib.mkIf config.local.profiles.desktop.enable { programs.ssh = { startAgent = true; }; + + hjem.users.${username} = { + files = { + ".ssh/config".text = '' + AddKeysToAgent yes + ''; + }; + }; }; }