nixos-configs/modules/tailscale.nix

38 lines
1.2 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}'";
2024-03-02 02:59:40 -05:00
# NAS
nos = "ssh -t matt@nos 'tmux -2u new -At ${hostName}'";
# Experimenting server
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}'";
2024-01-04 03:39:14 -05:00
};
};
2023-10-20 13:03:36 -04:00
}