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:
parent
28dbb529c0
commit
c0a49c95c1
1 changed files with 8 additions and 5 deletions
|
|
@ -410,11 +410,14 @@ in
|
||||||
# affect traffic destined for the bridge IP itself.
|
# affect traffic destined for the bridge IP itself.
|
||||||
networking.nameservers = [ networkCfg.bridgeIp ];
|
networking.nameservers = [ networkCfg.bridgeIp ];
|
||||||
# With privateNetwork=true + hostBridge the container's veth
|
# With privateNetwork=true + hostBridge the container's veth
|
||||||
# is bridge-attached. Enable DHCP so the container gets an IP
|
# is bridge-attached. Enable DHCP on eth0 so the container gets
|
||||||
# from dnsmasq on the bridge (hive-gateway serves the bridge
|
# an IP from dnsmasq on the bridge (hive-gateway serves the
|
||||||
# subnet). Matches how normal hive agent containers acquire
|
# bridge subnet). Per-interface rather than global: nixos-containers
|
||||||
# their addresses.
|
# sets networking.useDHCP = false for all containers (to silence
|
||||||
networking.useDHCP = true;
|
# 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
|
# nspawn containers can't create user-namespaces, so nix
|
||||||
# sandboxing always fails. Fall back to unsandboxed builds.
|
# sandboxing always fails. Fall back to unsandboxed builds.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue