devshell: Add container support to ssh-machine
Port `ssh-machine` to Python and derive container targets from their hosting boxes. Configure `tower` to prefer its home DNS name and fall back to its Tailscale name.
This commit is contained in:
1 parent
19265dfc75
commit
a75d94f492
9 files changed
+220
-91
No files matched your search
@@ -4,8 +4,8 @@ let
|
||||
devKey = ".keys/dev.key";
|
||||
sshMachine = pkgs.writeShellApplication {
|
||||
name = "ssh-machine";
|
||||
runtimeInputs = with pkgs; [ coreutils git jujutsu jq openssh ];
|
||||
text = builtins.readFile ./ssh-machine.sh;
|
||||
runtimeInputs = with pkgs; [ git jujutsu netcat-openbsd openssh ];
|
||||
text = ''exec ${pkgs.python3.interpreter} ${./ssh-machine.py} "$@"'';
|
||||
};
|
||||
in
|
||||
{
|
||||
@@ -56,7 +56,7 @@ in
|
||||
{
|
||||
name = "ssh-machine";
|
||||
category = "utilities";
|
||||
help = "SSH to a machine by NixOS system or home-manager config name";
|
||||
help = "Connect to a box, home-manager config or NixOS container by name";
|
||||
command = ''exec ${sshMachine}/bin/ssh-machine "$@"'';
|
||||
}
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user