Simplify tailscale autoconnect

This commit is contained in:
Greg Hellings
2025-12-28 21:18:34 -06:00
parent 8c99a92d77
commit d5a3723a6f
+3 -7
View File
@@ -16,7 +16,8 @@ let
text = ''
tailscale set --accept-routes
tailscale set --hostname ${cfg.hostname}
'';
''
+ lib.optionalString ((builtins.length cfg.tags) > 0) "tailscale set --advertise-tags ${tags}";
};
in
{
@@ -50,12 +51,7 @@ in
enable = true;
authKeyFile = config.age.secrets.tailscale-key.path;
authKeyParameters.preauthorized = true;
extraUpFlags = [
"--hostname"
cfg.hostname
"--accept-routes"
]
++ lib.optionals ((builtins.length cfg.tags) > 0) [
extraUpFlags = lib.optionals ((builtins.length cfg.tags) > 0) [
"--advertise-tags"
tags
];