mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-01-11 20:40:24 +01:00
fix: use networkd for all kubevirt guest
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user