Skip to content

Commit

Permalink
add tailscale funnel
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Dec 4, 2024
1 parent 6f9f633 commit 5b264ef
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
12 changes: 6 additions & 6 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"lastModified": 1732722421,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"rev": "9ed2ac151eada2306ca8c418ebd97807bb08f6ac",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -73,10 +73,10 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1730302582,
"lastModified": 1733318908,
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf",
"rev": "6f4e2a2112050951a314d2733a994fbab94864c6",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -191,10 +191,10 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1730327045,
"lastModified": 1733220138,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "080166c15633801df010977d9d7474b4a6c549d7",
"rev": "bcb68885668cccec12276bbb379f8f2557aa06ce",
"type": "github"
},
"original": {
Expand Down
27 changes: 27 additions & 0 deletions src/modules/services/tailscale.nix
Original file line number Diff line number Diff line change
@@ -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}";
};
};
}

0 comments on commit 5b264ef

Please sign in to comment.