nixos/tailscale: add option to pass flags to tailscaled

This commit is contained in:
Sandro Jäckel 2024-02-27 20:07:47 +01:00
parent e256f39bec
commit 6753857664
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5

View file

@ -66,6 +66,13 @@ in {
default = [];
example = ["--ssh"];
};
extraDaemonFlags = mkOption {
description = lib.mdDoc "Extra flags to pass to {command}`tailscaled`.";
type = types.listOf types.str;
default = [];
example = ["--no-logs-no-support"];
};
};
config = mkIf cfg.enable {
@ -80,7 +87,7 @@ in {
] ++ lib.optional config.networking.resolvconf.enable config.networking.resolvconf.package;
serviceConfig.Environment = [
"PORT=${toString cfg.port}"
''"FLAGS=--tun ${lib.escapeShellArg cfg.interfaceName}"''
''"FLAGS=--tun ${lib.escapeShellArg cfg.interfaceName} ${lib.concatStringsSep " " cfg.extraDaemonFlags}"''
] ++ (lib.optionals (cfg.permitCertUid != null) [
"TS_PERMIT_CERT_UID=${cfg.permitCertUid}"
]);