From ec02b316765c899fe2869e6aa1dac79c05c7a23c Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 14 May 2023 11:42:28 +0200 Subject: Feat(system/network): Add a tap device and bridges --- system/default.nix | 1 + system/network/default.nix | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 system/network/default.nix 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" + ]; + }; + }; +} -- cgit 1.4.1