From c1a76b4403edcf5e2a147d68b7bbdf1c33ac95ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 27 Jan 2024 13:20:03 +0100 Subject: Rework routers to use systemd-networkd --- nixos/machine/spt-mox2.nix | 52 ++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) (limited to 'nixos/machine/spt-mox2.nix') diff --git a/nixos/machine/spt-mox2.nix b/nixos/machine/spt-mox2.nix index 4d1a148..cf94798 100644 --- a/nixos/machine/spt-mox2.nix +++ b/nixos/machine/spt-mox2.nix @@ -7,45 +7,39 @@ with lib; { config = { cynerd = { + switch = { + enable = true; + lanAddress = "${config.cynerd.hosts.spt.mox2}/24"; + lanGateway = config.cynerd.hosts.spt.omnia; + }; wifiAP.spt = { enable = true; qca988x = { interface = "wls1"; - channel = 7; + bssids = ["04:f0:21:45:d3:47" "08:f0:21:45:d3:47"]; + channel = 1; }; }; }; - swapDevices = [ - { - device = "/dev/disk/by-partlabel/NixTurrisSwap"; - priority = 1; - } - ]; - networking = { - vlans = { - "brlan.guest" = { - id = 2; - interface = "brlan"; - }; - }; - bridges = { - brlan.interfaces = ["eth0"]; - brguest.interfaces = ["brlan.guest"]; + useNetworkd = true; + useDHCP = false; + }; + systemd.network.networks = { + "lan-brlan" = { + matchConfig.Name = "end0"; + networkConfig.Bridge = "brlan"; + bridgeVLANs = [ + { + bridgeVLANConfig = { + EgressUntagged = 1; + PVID = 1; + }; + } + {bridgeVLANConfig.VLAN = 2;} + ]; }; - interfaces.brlan.ipv4.addresses = [ - { - address = config.cynerd.hosts.spt.mox2; - prefixLength = 24; - } - ]; - defaultGateway = config.cynerd.hosts.spt.omnia; - nameservers = ["1.1.1.1" "8.8.8.8"]; - dhcpcd.allowInterfaces = []; }; - - # TODO: ubootTools build is broken! - firmware.environment.enable = false; }; } -- cgit v1.2.3