From 2287685c2cc949054530203827c24cbfcac8b681 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Thu, 19 Mar 2026 20:20:46 +0100 Subject: [PATCH] home/ssh: use %C for control socket paths --- home/modules/ssh.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/home/modules/ssh.nix b/home/modules/ssh.nix index 2a4e173..36c44b0 100644 --- a/home/modules/ssh.nix +++ b/home/modules/ssh.nix @@ -7,7 +7,7 @@ }: let inherit (lib) types; - controlSocket = "~/.ssh/controlmasters/%r@%n:%p.sock"; + controlSocket = "~/.ssh/controlmasters/%C.sock"; proxyTagType = types.submodule ( { name, ... }: @@ -93,10 +93,11 @@ in tag: tagDef: let dependency = if tagDef.after != null then lib.hm.dag.entryAfter tagDef.after else lib.id; + escapeOpensshConfig = builtins.replaceStrings ["%"] ["%%"]; in lib.nameValuePair "tagged-${tag}" { match = ''tagged="${tag}"''; - proxyCommand = "${lib.getExe pkgs.fc-scripts.ssh-multi-proxy} -v -p connect --control-path='${controlSocket}'${lib.optionalString tagDef.noDirect " -n"} -i ${lib.concatStringsSep "," tagDef.connectType}${ + proxyCommand = "${lib.getExe pkgs.fc-scripts.ssh-multi-proxy} -v -S ${config.programs.ssh.package}/bin/ssh -p connect${lib.optionalString tagDef.noDirect " -n"} --control-path='${escapeOpensshConfig controlSocket}' -i ${lib.concatStringsSep "," tagDef.connectType}${ lib.optionalString (tagDef.jumpHost != null) " -j ${tagDef.jumpHost}" } %h %p"; extraOptions = {