From 0ecbf4169c1d402f0dd26921871520dc019ef111 Mon Sep 17 00:00:00 2001 From: Kabbone Date: Mon, 9 Oct 2023 15:18:59 +0200 Subject: [PATCH] hosts: desktop: move to systemd-networkd --- hosts/desktop/hardware-configuration.nix | 63 ++++++------------------ modules/desktop/virtualisation/qemu.nix | 1 - 2 files changed, 16 insertions(+), 48 deletions(-) diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix index b05dde6..373241e 100644 --- a/hosts/desktop/hardware-configuration.nix +++ b/hosts/desktop/hardware-configuration.nix @@ -116,60 +116,29 @@ swapDevices = [ { device = "/swap/swapfile"; } ]; networking = { - vswitches = { - vs0 = { - interfaces = { - enp34s0 = { }; - lo1 = { - type = "internal"; - }; - #enp34s0iot = { - # type = "internal"; - # vlan = 100; - #}; - }; - }; - }; useDHCP = false; # Deprecated hostName = "hades"; - domain = "home.opel-online.de"; networkmanager = { enable = false; }; - timeServers = [ - "192.168.2.1" - ]; - interfaces = { - #enp34s0 = { - # useDHCP = true; # For versatility sake, manually edit IP on nm-applet. - # #ipv4.addresses = [ { - # # address = "192.168.0.51"; - # # prefixLength = 24; - # #} ]; - #}; - #enp34s0iot.useDHCP = true; - lo1 = { - useDHCP = true; - macAddress = "1a:20:e9:ce:9c:1a"; - }; - }; - #defaultGateway = "192.168.0.1"; - defaultGateway6 = { - address = "fe80::1"; - interface = "lo1"; - }; - #nameservers = [ "192.168.0.4" ]; - #firewall = { - # enable = false; - # #allowedUDPPorts = [ 53 67 ]; - # #allowedTCPPorts = [ 53 80 443 9443 ]; - #}; }; - systemd.services = { - "ovsdb".partOf = [ "network-setup.service" ]; - "ovs-vswitchd".partOf = [ "network-setup.service" ]; - "network-addresses-lo1".partOf = [ "network-setup.service" ]; + systemd.network = { + enable = true; + networks = { + "10-lan" = { + matchConfig.Name = "enp34s0"; + ntp = [ "192.168.2.1" ]; + domains = [ "home.opel-online.de" ]; + ipv6AcceptRAConfig = { + DHCPv6Client = "always"; + UseDNS = true; + }; + networkConfig = { + DHCP = "yes"; + }; + }; + }; }; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/modules/desktop/virtualisation/qemu.nix b/modules/desktop/virtualisation/qemu.nix index 306ff1c..1e4f94a 100644 --- a/modules/desktop/virtualisation/qemu.nix +++ b/modules/desktop/virtualisation/qemu.nix @@ -14,7 +14,6 @@ users.groups.libvirtd.members = [ "root" "${user}" ]; virtualisation = { - vswitch.enable = true; libvirtd = { enable = true; # Virtual drivers onShutdown = "shutdown";