summary refs log tree commit diff
path: root/nixos/modules/services/networking/tailscale.nix
diff options
context:
space:
mode:
authorLuke Granger-Brown <git@lukegb.com>2021-06-30 23:10:54 +0100
committerGitHub <noreply@github.com>2021-06-30 23:10:54 +0100
commitef4e133b1cd2f118b8826bb1f92dd3b0e2b28183 (patch)
tree80f5345bab405c0f4a41ad00d1a3fbe5d062734c /nixos/modules/services/networking/tailscale.nix
parent2b220cc57b198ae353afaf2b1859533c60e50bc0 (diff)
parent272773e1cbdd2f55f174b9b842669a39a64a700d (diff)
downloadnixpkgs-ef4e133b1cd2f118b8826bb1f92dd3b0e2b28183.tar
nixpkgs-ef4e133b1cd2f118b8826bb1f92dd3b0e2b28183.tar.gz
nixpkgs-ef4e133b1cd2f118b8826bb1f92dd3b0e2b28183.tar.bz2
nixpkgs-ef4e133b1cd2f118b8826bb1f92dd3b0e2b28183.tar.lz
nixpkgs-ef4e133b1cd2f118b8826bb1f92dd3b0e2b28183.tar.xz
nixpkgs-ef4e133b1cd2f118b8826bb1f92dd3b0e2b28183.tar.zst
nixpkgs-ef4e133b1cd2f118b8826bb1f92dd3b0e2b28183.zip
Merge branch 'master' into Xe/tailscale-sysctl-not-found
Diffstat (limited to 'nixos/modules/services/networking/tailscale.nix')
-rw-r--r--nixos/modules/services/networking/tailscale.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/tailscale.nix b/nixos/modules/services/networking/tailscale.nix
index d1b23b72a25..3f88ff53dff 100644
--- a/nixos/modules/services/networking/tailscale.nix
+++ b/nixos/modules/services/networking/tailscale.nix
@@ -15,6 +15,12 @@ in {
       description = "The port to listen on for tunnel traffic (0=autoselect).";
     };
 
+    interfaceName = mkOption {
+      type = types.str;
+      default = "tailscale0";
+      description = ''The interface name for tunnel traffic. Use "userspace-networking" (beta) to not use TUN.'';
+    };
+
     package = mkOption {
       type = types.package;
       default = pkgs.tailscale;
@@ -29,7 +35,10 @@ in {
     systemd.services.tailscaled = {
       wantedBy = [ "multi-user.target" ];
       path = [ pkgs.openresolv pkgs.procps ];
-      serviceConfig.Environment = "PORT=${toString cfg.port}";
+      serviceConfig.Environment = [
+        "PORT=${toString cfg.port}"
+        ''"FLAGS=--tun ${lib.escapeShellArg cfg.interfaceName}"''
+      ];
     };
   };
 }