From 9d5fdbea6ba20b69bf146b8118ab6ce0b4ebceb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Wed, 4 Dec 2024 14:23:42 +0000 Subject: [PATCH] services: add tailscale funnel --- src/modules/services/tailscale.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/modules/services/tailscale.nix diff --git a/src/modules/services/tailscale.nix b/src/modules/services/tailscale.nix new file mode 100644 index 000000000..ba57439da --- /dev/null +++ b/src/modules/services/tailscale.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.tailscale; +in +{ + options = { + services.tailscale = { + funnel = { + enable = mkEnableOption "Tailscale funnel"; + + target = mkOption { + type = types.str; + description = "Target host or host:port for Tailscale funnel"; + }; + }; + }; + }; + + config.processes = lib.mkIf cfg.funnel.enable { + "tailscale-funnel" = { + exec = "${pkgs.tailscale}/bin/tailscale funnel --yes ${cfg.funnel.target}"; + }; + }; +}