nix/nixos/common/services/tailscale.nix

25 lines
652 B
Nix
Raw Normal View History

2023-08-23 07:30:15 +02:00
{ config, pkgs, ... }: {
# Enable tailscale and open port 22 on it
2023-08-31 07:54:16 +02:00
services.tailscale = {
enable = true;
interfaceName = "tailscale0";
extraUpFlags = [
2023-09-15 16:50:03 +02:00
"--login-server=https://headscale.sysctl.io"
2023-08-31 13:29:14 +02:00
"--accept-dns"
"--accept-routes"
2023-08-31 07:54:16 +02:00
];
};
2023-08-23 10:14:13 +02:00
networking.firewall.interfaces.tailscale0.allowedTCPPorts = [ 22 ];
2024-01-05 06:59:23 +01:00
# Because of the split DNS< hosts forget which IP
# (external or internal) is promtail/loki.
# Setting them manually here helps.
networking.extraHosts = ''
100.64.0.14 influx.sysctl.io
100.64.0.14 loki.sysctl.io
'';
2024-01-06 04:22:24 +01:00
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = true;
};
2023-08-23 07:30:15 +02:00
}