From c3a0ad708e805451897f2bad41dda88ada1b323c Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Sat, 24 Aug 2024 01:02:59 +0200 Subject: [PATCH] fix(sj-srv1): DRY hostAddress and eth0 link status --- nix/os/devices/sj-srv1/system.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/nix/os/devices/sj-srv1/system.nix b/nix/os/devices/sj-srv1/system.nix index a6498a4..d8c2797 100644 --- a/nix/os/devices/sj-srv1/system.nix +++ b/nix/os/devices/sj-srv1/system.nix @@ -6,7 +6,9 @@ nodeFlake, nodeName, ... -}: { +}: let + hostBridgeAddress = "192.168.101.1"; +in { imports = [ ../../snippets/systemd-resolved.nix ]; @@ -42,7 +44,7 @@ br0 = { ipv4.addresses = [ { - address = "192.168.101.1"; + address = hostBridgeAddress; prefixLength = 24; } ]; @@ -66,6 +68,9 @@ enable = true; matchConfig.Name = "eth0"; + linkConfig.RequiredForOnline = "carrier"; + networkConfig.LinkLocalAddressing = "no"; + # TODO: i'm not sure if and if so why this is required macvlan = [ "dmz0" @@ -134,7 +139,7 @@ autoStart = true; hostBridge = "br0"; - hostAddress = "192.168.101.1"; + hostAddress = hostBridgeAddress; localAddress = "192.168.101.10/24"; imapsPort = 993; @@ -151,7 +156,7 @@ autoStart = true; hostBridge = "br0"; - hostAddress = "192.168.101.1"; + hostAddress = hostBridgeAddress; localAddress = "192.168.101.11/24"; httpPort = 80; @@ -166,7 +171,7 @@ autoStart = true; hostBridge = "br0"; - hostAddress = "192.168.101.1"; + hostAddress = hostBridgeAddress; localAddress = "192.168.101.12/24"; syncthingPort = 22000;