diff --git a/hosts/vm-jellyfin/default.nix b/hosts/vm-jellyfin/default.nix index 808e5dc..4c64d7e 100644 --- a/hosts/vm-jellyfin/default.nix +++ b/hosts/vm-jellyfin/default.nix @@ -16,7 +16,10 @@ home = true; proxies."jellyfin.home".target = "http://localhost:8096/"; proxies."jellyfin.thehellings.lan".target = "http://localhost:8096/"; - tailscale.enable = true; + tailscale = { + enable = true; + hostname = "jellyfin"; + }; }; environment.systemPackages = with pkgs; [ diff --git a/modules/nixos/tailscale.nix b/modules/nixos/tailscale.nix index ff7fe78..e5fae01 100644 --- a/modules/nixos/tailscale.nix +++ b/modules/nixos/tailscale.nix @@ -5,7 +5,15 @@ let in { options = { - greg.tailscale.enable = lib.mkEnableOption "Enable Tailscale"; + greg.tailscale = { + enable = lib.mkEnableOption "Enable Tailscale"; + + hostname = lib.mkOption { + description = "Name on the tailnet to use"; + default = config.networking.hostName; + type = lib.types.str; + }; + }; }; config = lib.mkIf cfg.enable { @@ -20,6 +28,10 @@ in enable = true; authKeyFile = config.age.secrets.tailscale-key.path; authKeyParameters.preauthorized = true; + extraUpFlags = [ + "--hostname" + cfg.hostname + ]; useRoutingFeatures = "both"; }; systemd.services.tailscaled.partOf = [ "network-online.target" ];