From 929ddd404aa2f9a61cef11e25657728ffdba1741 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 5 Jul 2024 10:57:00 -0400 Subject: [PATCH] refactor: pass host --- home/juspay.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/home/juspay.nix b/home/juspay.nix index 18dd4ff..5d876d8 100644 --- a/home/juspay.nix +++ b/home/juspay.nix @@ -2,15 +2,17 @@ let # I don't care to connect to VPN on my macbook # So, I'll clone through an office machine - gitCloneThroughVanjaram = + gitCloneThrough = { host, user }: let - host = "vanjaram"; port = 5445; gitSshRemote = "ssh.bitbucket.juspay.net"; in { programs.ssh.matchBlocks = { - ${host}.dynamicForwards = [{ inherit port; }]; + ${host} = { + inherit user; + dynamicForwards = [{ inherit port; }]; + }; ${gitSshRemote} = { user = "git"; proxyCommand = "nc -x localhost:${builtins.toString port} %h %p"; @@ -19,7 +21,9 @@ let }; in { - imports = [ gitCloneThroughVanjaram ]; + imports = [ + (gitCloneThrough { host = "vanjaram"; user = "srid"; }) + ]; programs.ssh = { matchBlocks = { # Juspay machines (through Tailscale)