about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--system/default.nix1
-rw-r--r--system/network/default.nix30
2 files changed, 31 insertions, 0 deletions
diff --git a/system/default.nix b/system/default.nix
index d1eba0b4..b7ff9b1e 100644
--- a/system/default.nix
+++ b/system/default.nix
@@ -7,6 +7,7 @@
     #./impermanence already at flake level imported
     ./libvirtd
     ./locale
+    ./network
     #./nixpkgs already at flake level imported
     ./options
     ./polkit
diff --git a/system/network/default.nix b/system/network/default.nix
new file mode 100644
index 00000000..c93d4e23
--- /dev/null
+++ b/system/network/default.nix
@@ -0,0 +1,30 @@
+# vim: ts=2
+{config, ...}: {
+  systemd.network.netdevs = {
+    "tab0" = {
+      netdevConfig = {
+        Name = "tap0";
+        Kind = "tap";
+      };
+      tapConfig = {
+        User = "${config.users.users.soispha.username}";
+        Group = "libvirt";
+      };
+    };
+    "br0" = {
+      netdevConfig = {
+        Name = "br0";
+        Kind = "bridge";
+      };
+    };
+  };
+  networking.bridges = {
+    br1 = {
+      interfaces = [
+        # TODO don't use hardcoded names
+        "enp4s0"
+        "tap0"
+      ];
+    };
+  };
+}