fix: use networkd for all kubevirt guest

This commit is contained in:
Ryan Yin
2024-04-01 00:45:40 +08:00
parent c628eaa6c8
commit 2047104704

View File

@@ -4,7 +4,9 @@
networking,
...
}: let
inherit (networking.hostsAddr.${hostName}) iface;
inherit (networking) mainGateway nameservers;
inherit (networking.hostsAddr.${hostName}) iface ipv4;
ipv4WithMask = "${ipv4}/24";
in {
# supported file systems, so we can mount any removable disks with these filesystems
boot.supportedFilesystems = [
@@ -16,11 +18,20 @@ in {
"exfat"
];
networking = {
inherit hostName;
inherit (networking) defaultGateway nameservers;
inherit (networking.hostsInterface.${hostName}) interfaces;
networkmanager.enable = false;
networking = {inherit hostName;};
networking.useNetworkd = true;
systemd.network.enable = true;
# Add ipv4 address to the bridge.
systemd.network.networks."10-${iface}" = {
matchConfig.Name = [iface];
networkConfig = {
Address = [ipv4WithMask];
Gateway = mainGateway;
DNS = nameservers;
IPv6AcceptRA = true;
};
linkConfig.RequiredForOnline = "routable";
};
# This value determines the NixOS release from which the default