diff options
| author | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-03-03 16:45:26 -0600 |
|---|---|---|
| committer | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-03-03 16:45:26 -0600 |
| commit | c29a14135736c2516bb5d951e6e97dc8143598db (patch) | |
| tree | 925628abfe934e3ea2cfd4a70357f8f9b5acb474 /pkgs/yossh/default.nix | |
| parent | ce2cc260710f801c10302847796b931f7ed19709 (diff) | |
changes
Diffstat (limited to 'pkgs/yossh/default.nix')
| -rw-r--r-- | pkgs/yossh/default.nix | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/yossh/default.nix b/pkgs/yossh/default.nix new file mode 100644 index 0000000..4ea0127 --- /dev/null +++ b/pkgs/yossh/default.nix @@ -0,0 +1,52 @@ +{ + pkgs, + inputs, + ... +}: let + yossh = + pkgs.writeText "yossh.lua" + # lua + '' + yoshi = dofile'${./yoshi.lua}' + + local function isHome() + local _, _, code = os.execute("nc -z -w1 192.168.50.2 2222") + return code == 0 + end + + yoshi.hosts["ganymede"] = function() + if isHome() then + return yoshi.ssh{ + HostName = "192.168.50.2", + DynamicForward = 9090, + Port = 2222 + } + else + return yoshi.ssh{ + HostName = "williamsfam.us.com", + DynamicForward = 9090 + } + end + end + + yoshi.hosts["io"] = function() + if isHome() then + return yoshi.ssh{ + HostName = "192.168.50.3", + User = "admin", + } + else + return yoshi.ssh{ + HostName = "192.168.50.3", + User = "admin", + ProxyJump = "collin@ganymede", + } + end + end + + yoshi.run(arg) + ''; +in + pkgs.writeShellScriptBin "yossh" '' + exec ${pkgs.lua}/bin/lua ${yossh} "$@" + '' |
