nixos-configs/modules/server/tailscale/default.nix
matt1432 2359a1a94f
All checks were successful
Discord / discord commits (push) Has been skipped
feat(tailscale): use extraSetFlags
2025-02-15 13:35:32 -05:00

48 lines
1.1 KiB
Nix

{
config,
lib,
...
}: let
inherit (lib) mkIf;
inherit (config.networking) hostName;
cfg = config.roles.server;
in {
config = mkIf (cfg.enable && cfg.tailscale.enable) {
services = {
tailscale = {
enable = true;
extraSetFlags = [
"--operator=${cfg.user}"
];
};
};
home-manager.users.${cfg.user} = {
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}'";
# NAS
nos = "ssh -t matt@nos 'tmux -2u new -At ${hostName}'";
# Experimenting server
servivi = "ssh -t matt@servivi 'tmux -2u new -At ${hostName}'";
# Home-assistant
homie = "ssh -t matt@homie '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}'";
};
};
};
# For accurate stack trace
_file = ./default.nix;
}