The other part of dotfiles

This commit is contained in:
Davide Pasetto 2024-06-27 15:31:12 +02:00
parent 2fbfed0e7a
commit 9f1ba4a64b
No known key found for this signature in database
GPG key ID: 8E7AB0CBE3149AF1
25 changed files with 1089 additions and 0 deletions

View file

@ -0,0 +1,39 @@
{ lib, config, pkgs, ... }:
let
cfg = config.tailscale;
in
{
options.tailscale = {
enable = lib.mkEnableOption "Enable Tailscale module";
authKeyFile = lib.mkOption {
default = "";
type = config.services.tailscale.authKeyFile.type;
description = config.services.tailscale.authKeyFile.description;
};
exitNode = lib.mkOption {
default = "";
description = ''
The tailscale IP of the optional exit node.
'';
};
extraUpFlags = lib.mkOption {
default = "";
type = config.services.tailscale.extraUpFlags.type;
description = config.services.tailscale.extraUpFlags.description;
};
};
config = lib.mkIf cfg.enable {
services.tailscale = {
enable = true;
authKeyFile = cfg.authKeyFile;
useRoutingFeatures = if cfg.exitNode == "" then "none" else "both";
extraUpFlags = [ "--exit-node=${cfg.exitNode}" ] ++ cfg.extraUpFlags;
};
};
}