fix(#2336): per-interface DHCP on eth0 instead of global useDHCP

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.
This commit is contained in:
atlas 2026-07-10 14:20:04 +02:00 committed by mara
commit c0a49c95c1

View file

@ -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.