mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-14 16:42:43 +02:00
fix: use networkd for all kubevirt guest
This commit is contained in:
@@ -4,7 +4,9 @@
|
|||||||
networking,
|
networking,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (networking.hostsAddr.${hostName}) iface;
|
inherit (networking) mainGateway nameservers;
|
||||||
|
inherit (networking.hostsAddr.${hostName}) iface ipv4;
|
||||||
|
ipv4WithMask = "${ipv4}/24";
|
||||||
in {
|
in {
|
||||||
# supported file systems, so we can mount any removable disks with these filesystems
|
# supported file systems, so we can mount any removable disks with these filesystems
|
||||||
boot.supportedFilesystems = [
|
boot.supportedFilesystems = [
|
||||||
@@ -16,11 +18,20 @@ in {
|
|||||||
"exfat"
|
"exfat"
|
||||||
];
|
];
|
||||||
|
|
||||||
networking = {
|
networking = {inherit hostName;};
|
||||||
inherit hostName;
|
networking.useNetworkd = true;
|
||||||
inherit (networking) defaultGateway nameservers;
|
systemd.network.enable = true;
|
||||||
inherit (networking.hostsInterface.${hostName}) interfaces;
|
|
||||||
networkmanager.enable = false;
|
# 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
|
# This value determines the NixOS release from which the default
|
||||||
|
|||||||
Reference in New Issue
Block a user