fix(sj-srv1): DRY hostAddress and eth0 link status

This commit is contained in:
steveej 2024-08-24 01:02:59 +02:00
parent 7d0515d6f0
commit c3a0ad708e

View file

@ -6,7 +6,9 @@
nodeFlake, nodeFlake,
nodeName, nodeName,
... ...
}: { }: let
hostBridgeAddress = "192.168.101.1";
in {
imports = [ imports = [
../../snippets/systemd-resolved.nix ../../snippets/systemd-resolved.nix
]; ];
@ -42,7 +44,7 @@
br0 = { br0 = {
ipv4.addresses = [ ipv4.addresses = [
{ {
address = "192.168.101.1"; address = hostBridgeAddress;
prefixLength = 24; prefixLength = 24;
} }
]; ];
@ -66,6 +68,9 @@
enable = true; enable = true;
matchConfig.Name = "eth0"; matchConfig.Name = "eth0";
linkConfig.RequiredForOnline = "carrier";
networkConfig.LinkLocalAddressing = "no";
# TODO: i'm not sure if and if so why this is required # TODO: i'm not sure if and if so why this is required
macvlan = [ macvlan = [
"dmz0" "dmz0"
@ -134,7 +139,7 @@
autoStart = true; autoStart = true;
hostBridge = "br0"; hostBridge = "br0";
hostAddress = "192.168.101.1"; hostAddress = hostBridgeAddress;
localAddress = "192.168.101.10/24"; localAddress = "192.168.101.10/24";
imapsPort = 993; imapsPort = 993;
@ -151,7 +156,7 @@
autoStart = true; autoStart = true;
hostBridge = "br0"; hostBridge = "br0";
hostAddress = "192.168.101.1"; hostAddress = hostBridgeAddress;
localAddress = "192.168.101.11/24"; localAddress = "192.168.101.11/24";
httpPort = 80; httpPort = 80;
@ -166,7 +171,7 @@
autoStart = true; autoStart = true;
hostBridge = "br0"; hostBridge = "br0";
hostAddress = "192.168.101.1"; hostAddress = hostBridgeAddress;
localAddress = "192.168.101.12/24"; localAddress = "192.168.101.12/24";
syncthingPort = 22000; syncthingPort = 22000;