From 89a605727649bb4599af04681e40a19bf24e69a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 23 Jan 2023 21:23:23 +0100 Subject: nixos: improve wifi configuration --- nixos/machine/spt-mox.nix | 60 ++++++++++++++--------------------------------- 1 file changed, 18 insertions(+), 42 deletions(-) (limited to 'nixos/machine/spt-mox.nix') diff --git a/nixos/machine/spt-mox.nix b/nixos/machine/spt-mox.nix index 84029c6..6ca780a 100644 --- a/nixos/machine/spt-mox.nix +++ b/nixos/machine/spt-mox.nix @@ -7,61 +7,37 @@ with builtins; with lib; { config = { - cynerd.home-assistant = true; - - networking.wirelessAP = { - enable = true; - environmentFile = "/run/secrets/hostapd.env"; - interfaces = { - "wls1" = { - countryCode = "CZ"; + cynerd = { + home-assistant = true; + wifiAP.spt = { + enable = true; + qca988x = { + interface = "wls1"; channel = 7; - hwMode = "g"; - ht_capab = ["HT40+" "SHORT-GI-20" "SHORT-GI-40" "TX-STBC" "RX-STBC1" "DSSS_CCK-40"]; - ssid = "TurrisRules"; - bridge = "brlan"; - wpa = 2; - wpaPassphrase = "@PASS_TURRIS_RULES@"; }; }; }; networking = { vlans = { - "eth0.2" = { + "brlan.guest" = { id = 2; - interface = "eth0"; + interface = "brlan"; }; }; bridges = { - brlan = { - interfaces = [ - "eth0" - "lan1" - "lan2" - "lan3" - "lan4" - ]; - }; - brguest = { - interfaces = [ - "eth0.2" - ]; - }; - }; - interfaces.brlan = { - ipv4 = { - addresses = [ - { - address = config.cynerd.hosts.spt.mox; - prefixLength = 24; - } - ]; - }; + brlan.interfaces = ["eth0" "lan1" "lan2" "lan3" "lan4"]; + brguest.interfaces = ["brlan.guest"]; }; + interfaces.brlan.ipv4.addresses = [ + { + address = config.cynerd.hosts.spt.mox; + prefixLength = 24; + } + ]; defaultGateway = config.cynerd.hosts.spt.omnia; - nameservers = [config.cynerd.hosts.spt.omnia "1.1.1.1" "8.8.8.8"]; - dhcpcd.allowInterfaces = ["brlan"]; + nameservers = ["1.1.1.1" "8.8.8.8"]; + dhcpcd.allowInterfaces = []; }; }; } -- cgit v1.2.3