From d60dccf4dcfbe75ebe5dc33e4bbce4fc52228297 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 1 Jul 2024 18:14:15 -0400 Subject: [PATCH] Clone some git repos through ssh jump Useful if that machine (vanjaram) can clone repos, but localhost cannot. --- home/juspay.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/home/juspay.nix b/home/juspay.nix index 96f717a..18dd4ff 100644 --- a/home/juspay.nix +++ b/home/juspay.nix @@ -1,6 +1,25 @@ # For Juspay work -{ pkgs, lib, ... }: +let + # I don't care to connect to VPN on my macbook + # So, I'll clone through an office machine + gitCloneThroughVanjaram = + let + host = "vanjaram"; + port = 5445; + gitSshRemote = "ssh.bitbucket.juspay.net"; + in + { + programs.ssh.matchBlocks = { + ${host}.dynamicForwards = [{ inherit port; }]; + ${gitSshRemote} = { + user = "git"; + proxyCommand = "nc -x localhost:${builtins.toString port} %h %p"; + }; + }; + }; +in { + imports = [ gitCloneThroughVanjaram ]; programs.ssh = { matchBlocks = { # Juspay machines (through Tailscale)