From 6f12ec10b8962e1c328c429886bb6daca28b5d6d Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 14 May 2023 12:47:06 +0200 Subject: Fix(system/network): Set networks for netdev devices --- system/network/default.nix | 54 ++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 21 deletions(-) (limited to 'system') diff --git a/system/network/default.nix b/system/network/default.nix index c93d4e23..5ddb06a3 100644 --- a/system/network/default.nix +++ b/system/network/default.nix @@ -1,30 +1,42 @@ # vim: ts=2 {config, ...}: { - systemd.network.netdevs = { - "tab0" = { - netdevConfig = { - Name = "tap0"; - Kind = "tap"; + systemd.network = { + networks = { + "tap0" = { + name = "tap0"; + bridge = [ + "virbr0" + ]; }; - tapConfig = { - User = "${config.users.users.soispha.username}"; - Group = "libvirt"; + "enp4s0" = { + name = "enp4s0"; + networkConfig = { + DHCP = "yes"; + DNSOverTLS = "yes"; + DNSSEC = "yes"; + }; + bridge = [ + "virbr0" + ]; }; }; - "br0" = { - netdevConfig = { - Name = "br0"; - Kind = "bridge"; + netdevs = { + "tap0" = { + netdevConfig = { + Name = "tap0"; + Kind = "tap"; + }; + tapConfig = { + User = "${config.users.users.soispha.username}"; + Group = "libvirt"; + }; + }; + "virbr0" = { + netdevConfig = { + Name = "br0"; + Kind = "bridge"; + }; }; - }; - }; - networking.bridges = { - br1 = { - interfaces = [ - # TODO don't use hardcoded names - "enp4s0" - "tap0" - ]; }; }; } -- cgit 1.4.1