about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-05-14 12:47:06 +0200
committerSoispha <soispha@vhack.eu>2023-05-14 12:47:06 +0200
commit6f12ec10b8962e1c328c429886bb6daca28b5d6d (patch)
treebade2dc814571e82a3ab71f88391738fd2e683ad
parentBuild(flake): Update (diff)
downloadnixos-config-6f12ec10b8962e1c328c429886bb6daca28b5d6d.tar.gz
nixos-config-6f12ec10b8962e1c328c429886bb6daca28b5d6d.zip
Fix(system/network): Set networks for netdev devices
-rw-r--r--system/network/default.nix54
1 files changed, 33 insertions, 21 deletions
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"
-      ];
     };
   };
 }