From 31e3c67be7d6f924d561a9300a62cb3d834d50f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 8 Nov 2022 21:49:52 +0100 Subject: nixos/spt-mox: tweak wifi --- common.sh | 2 +- nixos/machine/spt-mox.nix | 29 +++++++++-------------------- nixos/machine/spt-mox2.nix | 40 ++++++++++++---------------------------- 3 files changed, 22 insertions(+), 49 deletions(-) diff --git a/common.sh b/common.sh index 797457a..9b6f48c 100644 --- a/common.sh +++ b/common.sh @@ -62,7 +62,7 @@ _rootssh() { local device="$1" local cmd="$2" if [ "$device" != "$(hostname)" ]; then - ssh -t "$(sshdest "$device")" sudo "sh -c '${cmd@Q}'" + ssh -t "$(sshdest "$device")" sudo "sh -c '${cmd}'" else sudo sh -c "$cmd" fi diff --git a/nixos/machine/spt-mox.nix b/nixos/machine/spt-mox.nix index 5af8bff..037b10e 100644 --- a/nixos/machine/spt-mox.nix +++ b/nixos/machine/spt-mox.nix @@ -1,5 +1,6 @@ { config, lib, pkgs, ... }: +with builtins; with lib; { @@ -10,30 +11,18 @@ with lib; enable = true; environmentFile = "/run/secrets/hostapd.env"; interfaces = { - #"mlan0" = { - #countryCode = "CZ"; - #ssid = "TurrisRules"; - #wpa = true; - #wpaPassphrase = "@PASS_TURRIS_RULES@"; - #}; - "wlp1s0" = { + "wlp4s0" = { countryCode = "CZ"; - hwMode = "a"; - channel = 40; - ieee80211ac = true; - ht_capab = ["HT40+" "LDPC" "SHORT-GI-20" "SHORT-GI-40" "TX-STBC" "RX-STBC1" "MAX-AMSDU-7935" "DSSS_CCK-40"]; - vht_capab = ["RXLDPC" "SHORT-GI-80" "TX-STBC-2BY1" "RX-ANTENNA-PATTERN" "TX-ANTENNA-PATTERN" "RX-STBC-1" "MAX-MPDU-11454" "MAX-A-MPDU-LEN-EXP7"]; - ssid = "TurrisRules5"; + 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 = true; + wpa3 = false; wpaPassphrase = "@PASS_TURRIS_RULES@"; - bss = { - "wlp1s0host" = { - ssid = "KocoviGuest"; - wpa = true; - wpaPassphrase = "@PASS_KOCOVI@"; - }; - }; }; + # TODO use use wlp3s0 with 80211ax }; }; diff --git a/nixos/machine/spt-mox2.nix b/nixos/machine/spt-mox2.nix index 79109ee..c36bbdf 100644 --- a/nixos/machine/spt-mox2.nix +++ b/nixos/machine/spt-mox2.nix @@ -11,43 +11,27 @@ with lib; priority = 1; }]; - #boot.kernelPatches = [{ - # name = "rwtm"; - # patch = null; - # extraConfig = '' - # TURRIS_MOX_RWTM y - # ARMADA_37XX_RWTM_MBOX y - # ''; - #}]; - networking.wirelessAP = { enable = true; environmentFile = "/run/secrets/hostapd.env"; interfaces = { - #"mlan0" = { - #countryCode = "CZ"; - #ssid = "TurrisRules"; - #wpa = true; - #wpaPassphrase = "@PASS_TURRIS_RULES@"; - #}; "wlp1s0" = { countryCode = "CZ"; - hwMode = "a"; - channel = 40; - ieee80211ac = true; - ht_capab = ["HT40+" "LDPC" "SHORT-GI-20" "SHORT-GI-40" "TX-STBC" "RX-STBC1" "MAX-AMSDU-7935" "DSSS_CCK-40"]; - vht_capab = ["RXLDPC" "SHORT-GI-80" "TX-STBC-2BY1" "RX-ANTENNA-PATTERN" "TX-ANTENNA-PATTERN" "RX-STBC-1" "MAX-MPDU-11454" "MAX-A-MPDU-LEN-EXP7"]; - ssid = "TurrisRules5"; + channel = 7; + hwMode = "g"; + ht_capab = ["LDPC" "HT40+" "SHORT-GI-20" "SHORT-GI-40" "TX-STBC" "RX-STBC1" "MAX-AMSDU-7935" "DSSS_CCK-40"]; + ssid = "TurrisRules"; bridge = "brlan"; wpa = true; + wpa3 = false; wpaPassphrase = "@PASS_TURRIS_RULES@"; - bss = { - "wlp1s0host" = { - ssid = "KocoviGuest"; - wpa = true; - wpaPassphrase = "@PASS_KOCOVI@"; - }; - }; + #bss = { + # "wlp1s0host" = { + # ssid = "KocoviGuest"; + # wpa = true; + # wpaPassphrase = "@PASS_KOCOVI@"; + # }; + #}; }; }; }; -- cgit v1.2.3