Update tailscale module

Allow me to configure the hostname that tailscale reports
This commit is contained in:
Greg Hellings
2025-10-22 15:41:04 -05:00
parent 0bb96abdbe
commit 9e8e9aa514
2 changed files with 17 additions and 2 deletions
+4 -1
View File
@@ -16,7 +16,10 @@
home = true; home = true;
proxies."jellyfin.home".target = "http://localhost:8096/"; proxies."jellyfin.home".target = "http://localhost:8096/";
proxies."jellyfin.thehellings.lan".target = "http://localhost:8096/"; proxies."jellyfin.thehellings.lan".target = "http://localhost:8096/";
tailscale.enable = true; tailscale = {
enable = true;
hostname = "jellyfin";
};
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
+13 -1
View File
@@ -5,7 +5,15 @@ let
in in
{ {
options = { 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 { config = lib.mkIf cfg.enable {
@@ -20,6 +28,10 @@ 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 = [
"--hostname"
cfg.hostname
];
useRoutingFeatures = "both"; useRoutingFeatures = "both";
}; };
systemd.services.tailscaled.partOf = [ "network-online.target" ]; systemd.services.tailscaled.partOf = [ "network-online.target" ];