feat(tailscale): Enable warwick as exit node and subnet router

This commit is contained in:
Pim Kunis 2024-07-23 22:50:11 +02:00
parent 15e0dce041
commit 4e619eb0c4
3 changed files with 23 additions and 8 deletions

View file

@ -3,8 +3,11 @@
arch = "aarch64-linux";
isRaspberryPi = true;
nixosModule = {
lab.monitoring.server.enable = true;
nixosModule = { lib, ... }: {
lab = {
monitoring.server.enable = true;
tailscale.advertiseExitNode = true;
};
services.bird2 = {
enable = false;

View file

@ -2,12 +2,10 @@
config = {
networking = {
domain = "dmz";
nftables.enable = true;
nftables.enable = lib.mkDefault true;
useDHCP = false;
firewall = {
enable = true;
};
firewall.enable = lib.mkDefault true;
};
systemd.network = {

View file

@ -1,12 +1,26 @@
{ config, ... }: {
{ lib, config, ... }:
let
cfg = config.lab.tailscale;
in
{
options = {
lab.tailscale.advertiseExitNode = lib.mkOption {
type = lib.types.bool;
default = false;
};
};
config = {
services.tailscale = {
enable = true;
authKeyFile = config.sops.secrets."tailscale/authKey".path;
useRoutingFeatures = "server";
openFirewall = true;
extraUpFlags = [
"--hostname=${config.networking.hostName}"
];
] ++ lib.lists.optional cfg.advertiseExitNode "--advertise-exit-node"
++ lib.lists.optional cfg.advertiseExitNode "--advertise-routes=192.168.30.0/24";
};
sops.secrets."tailscale/authKey" = { };