route ssh user=pu via socks5 proxy

This commit is contained in:
Sridhar Ratnakumar 2026-05-15 10:36:20 -04:00
parent b3e9d9a89e
commit 682c8327c2

View file

@ -43,9 +43,15 @@ in
pu
];
# pu writes per-instance ssh_config files under ~/.pu-state/<name>/.
# Including them lets `ssh <name>` work directly without `pu connect`.
home-manager.users.${flake.config.me.username}.programs.ssh.includes = [
"~/.pu-state/*/ssh_config"
];
# pu writes per-instance ssh_config files under ~/.pu-state/<name>/. Including
# them lets `ssh <name>` work directly. The inner ssh those configs spawn goes
# to `pu@<PU_HOST>` which is only reachable via vanjaram — route any ssh to
# user `pu` through the SOCKS5 proxy.
home-manager.users.${flake.config.me.username}.programs.ssh = {
includes = [ "~/.pu-state/*/ssh_config" ];
matchBlocks."pu-jumphost" = {
match = "user pu";
proxyCommand = "${pkgs.netcat-openbsd}/bin/nc -X 5 -x 127.0.0.1:${toString socksPort} %h %p";
};
};
}