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 ceb67ee
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 30 deletions.
57 changes: 27 additions & 30 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,10 @@
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1730302582,
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"git-hooks",
"pre-commit-hooks",
"nixpkgs"
]
},
Expand Down Expand Up @@ -122,7 +100,7 @@
},
"nix": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"libgit2": "libgit2",
"nixpkgs": "nixpkgs",
Expand Down Expand Up @@ -191,10 +169,10 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1730327045,
"lastModified": 1731797254,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "080166c15633801df010977d9d7474b4a6c549d7",
"rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -249,15 +227,34 @@
"type": "github"
}
},
"pre-commit-hooks_2": {
"inputs": {
"flake-compat": "flake-compat_2",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1732021966,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"git-hooks": "git-hooks",
"nix": "nix",
"nixpkgs": "nixpkgs_2",
"pre-commit-hooks": [
"git-hooks"
]
"pre-commit-hooks": "pre-commit-hooks_2"
}
}
},
Expand Down
28 changes: 28 additions & 0 deletions src/modules/services/tailscale.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.services.tailscale;
in
{
options = {
services.tailscale = {
enable = mkEnableOption "Tailscale";

funnel = mkOption {
type = types.str;
description = "Target host or host:port for Tailscale funnel";
};
};
};

config = lib.mkIf cfg.enable {
packages = [ pkgs.tailscale ];
processes = lib.mkIf (cfg.funnel != null) {
"tailscale-funnel" = {
exec = "${pkgs.tailscale}/bin/tailscale funnel --yes ${cfg.funnel}";
};
};
};
}

0 comments on commit ceb67ee

Please sign in to comment.