summaryrefslogtreecommitdiff
path: root/hosts/omega-relay
diff options
context:
space:
mode:
authorJakub Stachurski <jakub@wilkuu.nl>2026-07-30 21:58:26 +0200
committerJakub Stachurski <jakub@wilkuu.nl>2026-07-30 21:58:26 +0200
commit869cecc8a0dd9f5af2e36c89ddabe54f25bc2ebc (patch)
tree6db251dbe2b3ee774dd7e07f679193c104a5cd97 /hosts/omega-relay
parent8da770badb7fe21df138e770c8d1a8b6c4604882 (diff)
Get inventory to manage monitoring connections
This makes it so you can define the monitoring in the inventory and tacitus will automatically, pick it up.
Diffstat (limited to 'hosts/omega-relay')
-rw-r--r--hosts/omega-relay/firewall.nix47
1 files changed, 24 insertions, 23 deletions
diff --git a/hosts/omega-relay/firewall.nix b/hosts/omega-relay/firewall.nix
index 0e82fea..8e35fa3 100644
--- a/hosts/omega-relay/firewall.nix
+++ b/hosts/omega-relay/firewall.nix
@@ -1,5 +1,12 @@
-{ config, lib, ... }:
+{
+ config,
+ lib,
+ inventory,
+ self_name,
+ ...
+}:
let
+ net = inventory.${self_name}.interfaces;
wgHomePort = 16888;
baseTCP = [
20
@@ -23,16 +30,7 @@ let
secureTCP = [
# config.wilkuu.services.mysql.port
- ]
- ++ lib.mapAttrsToList (_: opt: opt.port) (
- lib.filterAttrs (
- _: e:
- let
- evaluated = builtins.tryEval e;
- in
- evaluated.success && e ? enable && e.enable
- ) config.services.prometheus.exporters
- );
+ ];
secureUDP = [
];
@@ -63,7 +61,7 @@ in
useNetworkd = true;
interfaces = {
wg-home = {
- ips = [ "192.168.80.100/24" ];
+ ips = [ "${net.wg-home.ip}/24" ];
extraOptions = {
DNS = "192.168.88.1";
};
@@ -113,24 +111,27 @@ in
linkConfig.RequiredForOnline = "routable";
};
- networking.useDHCP = false;
- networking.useNetworkd = true;
- networking.nftables.enable = true;
- networking.firewall = {
+ wilkuu.firewall = {
enable = true;
- checkReversePath = false;
- allowedTCPPorts = baseTCP;
- allowedUDPPorts = baseUDP;
- allowedUDPPortRanges = baseUDPRanges;
- allowedTCPPortRanges = baseTCPRanges;
- interfaces = {
- "wg-home" = {
+ defaultLayer = "external";
+ layers = {
+ external = {
+ allowedTCPPorts = baseTCP;
+ allowedUDPPorts = baseUDP;
+ allowedUDPPortRanges = baseUDPRanges;
+ allowedTCPPortRanges = baseTCPRanges;
+ };
+ internal = {
allowedTCPPorts = secureTCP;
allowedUDPPorts = secureUDP;
allowedUDPPortRanges = secureUDPRanges;
allowedTCPPortRanges = secureTCPRanges;
};
};
+ };
+ networking.useDHCP = false;
+ networking.useNetworkd = true;
+ networking.firewall = {
trustedInterfaces = [
"docker0"
"br-*"