4e925f8a89
also added the configuration bc idk how to add only certain files but whatever
31 lines
739 B
Nix
31 lines
739 B
Nix
{ config, lib, ... }:
|
|
let
|
|
cfg = config.homelab.networking.tailscale;
|
|
user = config.homelab.networking.user;
|
|
in
|
|
{
|
|
config = lib.mkIf cfg.enable {
|
|
services.tailscale = {
|
|
enable = true;
|
|
openFirewall = true;
|
|
extraSetFlags = [ "--operator=${user}" ];
|
|
};
|
|
|
|
networking.firewall = {
|
|
trustedInterfaces = [ config.services.tailscale.interfaceName ];
|
|
allowedUDPPorts = [ config.services.tailscale.port ];
|
|
};
|
|
|
|
systemd.services.tailscaled.serviceConfig.Environment = [
|
|
"TS_DEBUG_FIREWALL_MODE=nftables"
|
|
];
|
|
|
|
systemd.network.wait-online.enable = false;
|
|
boot.initrd.systemd.network.wait-online.enable = false;
|
|
|
|
users.users.${user}.extraGroups = [
|
|
"tailscale"
|
|
];
|
|
};
|
|
}
|