servers/common/tailscale.nix

33 lines
526 B
Nix
Raw Normal View History

{
config,
lib,
...
2026-02-24 00:00:35 -08:00
}:
let
inherit (lib)
mkEnableOption
mkOption
types
mkIf
;
cfg = config.foehammer.tailscale;
2026-02-24 00:00:35 -08:00
in
{
options.foehammer.tailscale = {
enable = mkEnableOption "Enable tailscale";
authKeyFile = mkOption {
type = types.nullOr types.path;
};
};
config = mkIf cfg.enable {
services.tailscale = {
enable = true;
authKeyFile = cfg.authKeyFile;
openFirewall = true;
};
2026-02-24 00:00:35 -08:00
networking.firewall.trustedInterfaces = [ "tailscale0" ];
};
}