From c0a49c95c128c7d2574e45da2ee8b1735b3d6238 Mon Sep 17 00:00:00 2001 From: atlas Date: Fri, 10 Jul 2026 14:20:04 +0200 Subject: [PATCH] fix(#2336): per-interface DHCP on eth0 instead of global useDHCP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nixos-containers.nix sets networking.useDHCP = false for every container (to suppress the deprecated global DHCP warning). Setting networking.useDHCP = true in the hive-ci inner config conflicts with no priority differential → eval error on hosts running current main. Fix: drop the global useDHCP = true and configure DHCP on eth0 (the inner veth interface name assigned by systemd-nspawn when hostBridge is used). This is both conflict-free and the correct modern NixOS practice for per-interface DHCP. --- nix/modules/hive-ci.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/nix/modules/hive-ci.nix b/nix/modules/hive-ci.nix index a2ed4e61..96ddebdb 100644 --- a/nix/modules/hive-ci.nix +++ b/nix/modules/hive-ci.nix @@ -410,11 +410,14 @@ in # affect traffic destined for the bridge IP itself. networking.nameservers = [ networkCfg.bridgeIp ]; # With privateNetwork=true + hostBridge the container's veth - # is bridge-attached. Enable DHCP so the container gets an IP - # from dnsmasq on the bridge (hive-gateway serves the bridge - # subnet). Matches how normal hive agent containers acquire - # their addresses. - networking.useDHCP = true; + # is bridge-attached. Enable DHCP on eth0 so the container gets + # an IP from dnsmasq on the bridge (hive-gateway serves the + # bridge subnet). Per-interface rather than global: nixos-containers + # sets networking.useDHCP = false for all containers (to silence + # the deprecated global DHCP warning), so setting useDHCP = true + # globally would conflict. eth0 is the inner veth name assigned + # by systemd-nspawn when hostBridge is used. + networking.interfaces.eth0.useDHCP = true; # nspawn containers can't create user-namespaces, so nix # sandboxing always fails. Fall back to unsandboxed builds.