Simplify tailscale autoconnect
This commit is contained in:
@@ -16,7 +16,8 @@ let
|
|||||||
text = ''
|
text = ''
|
||||||
tailscale set --accept-routes
|
tailscale set --accept-routes
|
||||||
tailscale set --hostname ${cfg.hostname}
|
tailscale set --hostname ${cfg.hostname}
|
||||||
'';
|
''
|
||||||
|
+ lib.optionalString ((builtins.length cfg.tags) > 0) "tailscale set --advertise-tags ${tags}";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -50,12 +51,7 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
authKeyFile = config.age.secrets.tailscale-key.path;
|
authKeyFile = config.age.secrets.tailscale-key.path;
|
||||||
authKeyParameters.preauthorized = true;
|
authKeyParameters.preauthorized = true;
|
||||||
extraUpFlags = [
|
extraUpFlags = lib.optionals ((builtins.length cfg.tags) > 0) [
|
||||||
"--hostname"
|
|
||||||
cfg.hostname
|
|
||||||
"--accept-routes"
|
|
||||||
]
|
|
||||||
++ lib.optionals ((builtins.length cfg.tags) > 0) [
|
|
||||||
"--advertise-tags"
|
"--advertise-tags"
|
||||||
tags
|
tags
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user