mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 16:21:34 +01:00
Rename module namespaces
This commit is contained in:
parent
0dcf8cc292
commit
ca1357b2d4
35 changed files with 4 additions and 4 deletions
26
modules/system/tailscale.nix
Normal file
26
modules/system/tailscale.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.myConfig.tailscale;
|
||||
in
|
||||
{
|
||||
options.myConfig.tailscale = {
|
||||
enable = lib.mkEnableOption "";
|
||||
ssh.enable = lib.mkEnableOption "";
|
||||
exitNode.enable = lib.mkEnableOption "";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sops.secrets.tailscale-auth-key.restartUnits = [ "tailscaled-autoconnect.service" ];
|
||||
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
authKeyFile = config.sops.secrets.tailscale-auth-key.path;
|
||||
openFirewall = true;
|
||||
useRoutingFeatures = if cfg.exitNode.enable then "server" else "client";
|
||||
extraUpFlags = [
|
||||
(lib.mkIf cfg.ssh.enable "--ssh")
|
||||
(lib.mkIf cfg.exitNode.enable "--advertise-exit-node")
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue