nixos-configs/modules/tailscale.nix

41 lines
1.3 KiB
Nix
Raw Normal View History

{config, ...}: let
inherit (config.vars) hostName mainUser;
in {
2023-10-20 13:03:36 -04:00
services = {
tailscale = {
enable = true;
2024-01-04 03:39:14 -05:00
# TODO: add authKeyFile to get extraUpFlags to work
2024-01-24 16:11:18 -05:00
# https://github.com/juanfont/headscale/issues/1550
# https://github.com/juanfont/headscale/blob/main/docs/running-headscale-linux-manual.md#register-machine-using-a-pre-authenticated-key
# https://www.reddit.com/r/NixOS/comments/18kz1nb/tailscale_extraupflags_not_working/
2023-10-20 13:03:36 -04:00
extraUpFlags = [
"--login-server https://headscale.nelim.org"
"--operator=matt"
];
};
};
home-manager.users.${mainUser} = {
2024-01-04 03:39:14 -05:00
programs.bash.shellAliases = {
# Connect to headscale
2024-01-04 03:39:14 -05:00
tup = "tailscale up --login-server https://headscale.nelim.org";
# Desktop
2024-01-04 03:39:14 -05:00
pc = "ssh -t matt@binto 'tmux -2u new -At ${hostName}'";
# Misc Nix servers
2024-01-04 03:39:14 -05:00
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
2024-01-04 03:39:14 -05:00
pve = "ssh -t matt@pve 'tmux -2u new -At ${hostName}'";
# Proxmox LXC instances
2024-01-04 03:39:14 -05:00
jelly = "mosh matt@pve -- ssh -t matt@10.0.0.123 'tmux -2u new -At ${hostName}'";
};
};
2023-10-20 13:03:36 -04:00
}