From 767e131dbb2c08909625a8154e05b2f24d219105 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Thu, 23 May 2024 15:30:55 +0300 Subject: [PATCH] Create control path when it doesn't exist --- modules/ssh/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/ssh/default.nix b/modules/ssh/default.nix index d6cbc7e..0521d08 100644 --- a/modules/ssh/default.nix +++ b/modules/ssh/default.nix @@ -11,10 +11,17 @@ mosh ])) -(homeConfiguration { +(let + controlPath = "~/.ssh/control"; +in homeConfiguration { + home.activation.createControlPath = { + after = [ "writeBoundary" ]; + data = "mkdir --parents ${controlPath}"; + }; + programs.ssh = enabled { controlMaster = "auto"; - controlPath = "~/.ssh/control/%r@%n:%p"; + controlPath = "${controlPath}/%r@%n:%p"; controlPersist = "60m"; serverAliveCountMax = 2; serverAliveInterval = 60;