nixos-configs/modules/tailscale.nix
matt1432 1cfbf18866
All checks were successful
Discord / discord commits (push) Has been skipped
feat(tailscale): add ssh aliases for cluster nodes
2024-01-23 08:06:18 -05:00

41 lines
1.2 KiB
Nix

{config, ...}: let
inherit (config.vars) hostName mainUser;
in {
services = {
tailscale = {
enable = true;
# TODO: add authKeyFile to get extraUpFlags to work
extraUpFlags = [
"--login-server https://headscale.nelim.org"
"--operator=matt"
];
};
};
home-manager.users.${mainUser} = {
programs.bash.shellAliases = {
# Connect to headscale
tup = "tailscale up --login-server https://headscale.nelim.org";
# Desktop
pc = "ssh -t matt@binto 'tmux -2u new -At ${hostName}'";
# Misc Nix servers
oksys = "ssh -t matt@oksys 'tmux -2u new -At ${hostName}'";
servivi = "ssh -t matt@servivi 'tmux -2u new -At ${hostName}'";
# Cluster nodes
thingone = "ssh -t matt@thingone 'tmux -2u new -At ${hostName}'";
thingtwo = "ssh -t matt@thingtwo 'tmux -2u new -At ${hostName}'";
# Proxmox
pve = "ssh -t matt@pve 'tmux -2u new -At ${hostName}'";
# Proxmox LXC instances
pod = "mosh matt@pve -- ssh -t -p 6768 matt@10.0.0.122 'tmux -2u new -At ${hostName}'";
jelly = "mosh matt@pve -- ssh -t matt@10.0.0.123 'tmux -2u new -At ${hostName}'";
qbit = "mosh matt@pve -- ssh -t matt@10.0.0.128 'tmux -2u new -At ${hostName}'";
};
};
}