Add tailscale to hs

This commit is contained in:
Yan Lin 2025-09-07 01:03:18 +02:00
parent b57aee3d67
commit 8d1ad43eea
2 changed files with 16 additions and 4 deletions

View file

@ -3,6 +3,7 @@
./hardware-configuration.nix ./hardware-configuration.nix
./disk-config.nix ./disk-config.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
../../../modules/tailscale.nix
]; ];
# GRUB bootloader with ZFS support # GRUB bootloader with ZFS support

View file

@ -1,11 +1,22 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
# Enable Tailscale service # Enable Tailscale service for NixOS
services.tailscale = { services.tailscale = {
enable = true; enable = true;
# Override local DNS to use Tailscale's MagicDNS # Enable MagicDNS for better name resolution on NixOS server
# This ensures Tailscale DNS resolution works properly on macOS useRoutingFeatures = "server";
overrideLocalDns = false; extraUpFlags = [
"--advertise-routes=10.1.1.0/24"
"--advertise-exit-node"
];
};
# Allow Tailscale through the firewall if enabled
networking.firewall = {
# Allow Tailscale UDP port
allowedUDPPorts = [ 41641 ];
# Allow traffic from Tailscale subnet
trustedInterfaces = [ "tailscale0" ];
}; };
} }