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"; arch = "aarch64-linux";
isRaspberryPi = true; isRaspberryPi = true;
nixosModule = { nixosModule = { lib, ... }: {
lab.monitoring.server.enable = true; lab = {
monitoring.server.enable = true;
tailscale.advertiseExitNode = true;
};
services.bird2 = { services.bird2 = {
enable = false; enable = false;

View file

@ -2,12 +2,10 @@
config = { config = {
networking = { networking = {
domain = "dmz"; domain = "dmz";
nftables.enable = true; nftables.enable = lib.mkDefault true;
useDHCP = false; useDHCP = false;
firewall = { firewall.enable = lib.mkDefault true;
enable = true;
};
}; };
systemd.network = { 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 = { config = {
services.tailscale = { services.tailscale = {
enable = true; enable = true;
authKeyFile = config.sops.secrets."tailscale/authKey".path; authKeyFile = config.sops.secrets."tailscale/authKey".path;
useRoutingFeatures = "server";
openFirewall = true;
extraUpFlags = [ extraUpFlags = [
"--hostname=${config.networking.hostName}" "--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" = { }; sops.secrets."tailscale/authKey" = { };