diff options
| author | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-01-25 22:32:59 -0600 |
|---|---|---|
| committer | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-01-25 22:32:59 -0600 |
| commit | 94f08f5ca042cd2d65379b13767096936f8028ce (patch) | |
| tree | 2de57e60d2a375c808f039e560fa42be8e79b2f4 /pkgs/yoshi.nix | |
| parent | 606b7ae3bb2b45e094132dbec4574faa4317331f (diff) | |
changes
Diffstat (limited to 'pkgs/yoshi.nix')
| -rw-r--r-- | pkgs/yoshi.nix | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/pkgs/yoshi.nix b/pkgs/yoshi.nix new file mode 100644 index 0000000..14341a0 --- /dev/null +++ b/pkgs/yoshi.nix @@ -0,0 +1,53 @@ +{ + pkgs, + inputs, + ... +}: let + yossh = + pkgs.writeText "yossh.lua" + # lua + '' + yoshi = dofile'${inputs.yoshi-lua}/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", + Port = 2222, + LocalForward = 8010 + } + else + return yoshi.ssh{ + HostName = "williamsfam.us.com", + LocalForward = 8010, + DynamicFoward = 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} "$@" + '' |
