Shorten the subdomains of hosted services

This commit is contained in:
SebastianStork 2024-09-17 23:02:00 +02:00
parent 18bbe1fd27
commit 4db060800b
6 changed files with 50 additions and 24 deletions

View file

@ -10,6 +10,10 @@ in
{
options.myConfig.tailscale = {
enable = lib.mkEnableOption "";
subdomain = lib.mkOption {
type = lib.types.nonEmptyStr;
default = config.networking.hostName;
};
ssh.enable = lib.mkEnableOption "";
exitNode.enable = lib.mkEnableOption "";
serve = lib.mkOption {
@ -28,6 +32,7 @@ in
useRoutingFeatures = if (cfg.exitNode.enable || (cfg.serve != null)) then "server" else "client";
extraUpFlags = [ "--reset=true" ];
extraSetFlags = [
"--hostname=${cfg.subdomain}"
"--ssh=${lib.boolToString cfg.ssh.enable}"
"--advertise-exit-node=${lib.boolToString cfg.exitNode.enable}"
];