nixos/lxc/container: fix useDhcp with veth (#358806)

This commit is contained in:
Adam C. Stephens 2024-11-29 10:45:09 -05:00 committed by GitHub
commit 6de1312a38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,6 +31,22 @@
${config.nix.package.out}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system ${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 { system.build.tarball = pkgs.callPackage ../../lib/make-system-tarball.nix {
extraArgs = "--owner=0"; extraArgs = "--owner=0";