nixos/lxc/container: fix useDhcp with veth
https://github.com/NixOS/nixpkgs/pull/347283 changed the default to exclude non-physical network Kind, but that unfortunately also includes `veth` which LXC uses for its network interfaces. Re-enable that functionality so users can use networkd with useDHCP.
This commit is contained in:
parent
964bdaac30
commit
f50a1bd99d
@ -31,6 +31,22 @@
|
||||
${config.nix.package.out}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system
|
||||
'';
|
||||
|
||||
# supplement 99-ethernet-default-dhcp which excludes veth
|
||||
systemd.network = lib.mkIf config.networking.useDHCP {
|
||||
networks."99-lxc-veth-default-dhcp" = {
|
||||
matchConfig = {
|
||||
Type = "ether";
|
||||
Kind = "veth";
|
||||
Name = [
|
||||
"en*"
|
||||
"eth*"
|
||||
];
|
||||
};
|
||||
DHCP = "yes";
|
||||
networkConfig.IPv6PrivacyExtensions = "kernel";
|
||||
};
|
||||
};
|
||||
|
||||
system.build.tarball = pkgs.callPackage ../../lib/make-system-tarball.nix {
|
||||
extraArgs = "--owner=0";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user