This commit is contained in:
2026-05-30 19:03:33 +09:00
parent f5ecef894d
commit 5f1cfc5275
155 changed files with 4168 additions and 300 deletions
+38
View File
@@ -0,0 +1,38 @@
{ lib, config, ... }:
let
cfg = config.my.applications.tailscale;
in
{
options.my.applications.tailscale = {
enable = lib.mkEnableOption "Tailscale VPN";
acceptDns = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Accept DNS configuration from Tailscale";
};
acceptRoutes = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Accept subnet routes from Tailscale";
};
extraUpFlags = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
description = "Additional flags to pass to tailscale up";
};
};
config = lib.mkIf cfg.enable {
services.tailscale = {
enable = true;
extraUpFlags = [
"--accept-dns=${if cfg.acceptDns then "true" else "false"}"
]
++ lib.optional cfg.acceptRoutes "--accept-routes"
++ cfg.extraUpFlags;
};
};
}