-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathssh.nix
49 lines (48 loc) · 1.08 KB
/
ssh.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# this set of pog scripts creates some wrappers around ssh to make things easier
final: prev:
with prev;
rec {
pogproxy = pog {
name = "pogproxy";
description = "a quick and easy way to set up a socks proxy through ssh";
flags = [
_.flags.ssh.host
{
name = "bind_host";
description = "the local ip to bind to";
default = "127.0.0.1";
}
{
name = "port";
description = "the local port to bind to";
default = "1337";
}
{
name = "user";
description = "the user to use for the ssh connection";
}
{
name = "fork";
description = "fork and run this proxy in the background";
bool = true;
}
{
name = "quiet";
description = "run the proxy in quiet mode";
bool = true;
}
];
script = helpers: ''
ssh \
-D "''${bind_host}:''${port}" \
-C \
-N \
''${quiet:+-q} \
''${fork:+-f} \
"''${user:+user@}''${host}"
'';
};
ssh_pog_scripts = [
pogproxy
];
}