aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2025-01-19 14:37:11 +0100
committerKarel Kočí <cynerd@email.cz>2025-01-19 14:37:11 +0100
commitc274720eba80d1434f073d2cafbcd8401d89a40d (patch)
tree4d2a7fcbad32359c5290ff7a61cecc919c420474
parent39dea4d3636b3162c7ff72977c25e7c713faade1 (diff)
downloadnixos-personal-c274720eba80d1434f073d2cafbcd8401d89a40d.tar.gz
nixos-personal-c274720eba80d1434f073d2cafbcd8401d89a40d.tar.bz2
nixos-personal-c274720eba80d1434f073d2cafbcd8401d89a40d.zip
nixos: improve adm wifi network
Remove overlap.
-rw-r--r--flake.lock24
-rw-r--r--nixos/configurations/adm-omnia.nix10
-rw-r--r--nixos/modules/wifi-adm.nix82
-rw-r--r--nixos/modules/wifi-spt.nix79
4 files changed, 78 insertions, 117 deletions
diff --git a/flake.lock b/flake.lock
index e9072b8..724dc3e 100644
--- a/flake.lock
+++ b/flake.lock
@@ -8,11 +8,11 @@
"systems": "systems"
},
"locked": {
- "lastModified": 1723293904,
- "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
+ "lastModified": 1736955230,
+ "narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=",
"owner": "ryantm",
"repo": "agenix",
- "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
+ "rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c",
"type": "github"
},
"original": {
@@ -201,11 +201,11 @@
},
"nixos-hardware": {
"locked": {
- "lastModified": 1736441705,
- "narHash": "sha256-OL7leZ6KBhcDF3nEKe4aZVfIm6xQpb1Kb+mxySIP93o=",
+ "lastModified": 1736978406,
+ "narHash": "sha256-oMr3PVIQ8XPDI8/x6BHxsWEPBRU98Pam6KGVwUh8MPk=",
"owner": "NixOS",
"repo": "nixos-hardware",
- "rev": "8870dcaff63dfc6647fb10648b827e9d40b0a337",
+ "rev": "b678606690027913f3434dea3864e712b862dde5",
"type": "github"
},
"original": {
@@ -245,11 +245,11 @@
},
"nixpkgs_3": {
"locked": {
- "lastModified": 1736657626,
- "narHash": "sha256-FWlPMUzp0lkQBdhKlPqtQdqmp+/C+1MBiEytaYfrCTY=",
+ "lastModified": 1737110817,
+ "narHash": "sha256-DSenga8XjPaUV5KUFW/i3rNkN7jm9XmguW+qQ1ZJTR4=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "2f9e2f85cb14a46410a1399aa9ea7ecf433e422e",
+ "rev": "041c867bad68dfe34b78b2813028a2e2ea70a23c",
"type": "github"
},
"original": {
@@ -560,11 +560,11 @@
},
"vpsadminos": {
"locked": {
- "lastModified": 1734458258,
- "narHash": "sha256-xZEbuwAAbxwujrGtuydDNBjzMLnE9YOcuLv3hdudZe4=",
+ "lastModified": 1737136524,
+ "narHash": "sha256-wMy7IbQs87VUxJOqRSbfFIdxRRTUBQh8G1L/zwI36vY=",
"owner": "vpsfreecz",
"repo": "vpsadminos",
- "rev": "83ddccf4462f155f12596af773e9291d7ebc37a3",
+ "rev": "0af10d77ca146293b2ed19d5dcfd98474f1fc285",
"type": "github"
},
"original": {
diff --git a/nixos/configurations/adm-omnia.nix b/nixos/configurations/adm-omnia.nix
index 4683cf2..e472432 100644
--- a/nixos/configurations/adm-omnia.nix
+++ b/nixos/configurations/adm-omnia.nix
@@ -23,16 +23,16 @@ in {
};
};
wifiAP.adm = {
- enable = false;
+ enable = true;
ar9287 = {
- interface = "wlp1s0";
+ interface = "wlp2s0";
bssids = config.secrets.wifiMacs.adm-omnia.ar9287;
- channel = 11;
+ channel = 7;
};
qca988x = {
- interface = "wlp3s0";
+ interface = "wlp1s0";
bssids = config.secrets.wifiMacs.adm-omnia.qca988x;
- channel = 36;
+ channel = 44;
};
};
wireguard = true;
diff --git a/nixos/modules/wifi-adm.nix b/nixos/modules/wifi-adm.nix
index 1db730c..7d6b5a6 100644
--- a/nixos/modules/wifi-adm.nix
+++ b/nixos/modules/wifi-adm.nix
@@ -6,6 +6,34 @@
inherit (lib) mkOption mkEnableOption types mkIf hostapd elemAt;
cnf = config.cynerd.wifiAP.adm;
+ networks = name: {
+ "${cnf."${name}".interface}" = {
+ bssid = elemAt cnf."${name}".bssids 0;
+ ssid = "TurrisAdamkovi";
+ authentication = {
+ mode = "wpa3-sae-transition";
+ wpaPasswordFile = "/run/secrets/hostapd-TurrisAdamkovi.pass";
+ saePasswordsFile = "/run/secrets/hostapd-TurrisAdamkovi.pass";
+ };
+ };
+ "${cnf."${name}".interface}-nela" = {
+ bssid = elemAt cnf."${name}".bssids 1;
+ ssid = "Nela";
+ authentication = {
+ mode = "wpa2-sha256";
+ wpaPasswordFile = "/run/secrets/hostapd-Nela.pass";
+ };
+ };
+ "${cnf."${name}".interface}.milan" = {
+ bssid = elemAt cnf."${name}".bssids 2;
+ ssid = "MILAN-AC";
+ authentication = {
+ mode = "wpa2-sha1";
+ wpaPasswordFile = "/run/secrets/hostapd-MILAN-AC.pass";
+ };
+ };
+ };
+
wOptions = card: channelDefault: {
interface = mkOption {
type = with types; nullOr str;
@@ -43,32 +71,7 @@ in {
enable = true;
inherit (hostapd.qualcomAtherosAR9287.wifi4) capabilities;
};
- networks = {
- "${cnf.ar9287.interface}" = {
- bssid = elemAt cnf.ar9287.bssids 0;
- ssid = "TurrisAdamkovi";
- authentication = {
- mode = "wpa2-sha256";
- wpaPasswordFile = "/run/secrets/hostapd-TurrisAdamkovi.pass";
- };
- };
- "${cnf.ar9287.interface}-nela" = {
- bssid = elemAt cnf.ar9287.bssids 1;
- ssid = "Nela";
- authentication = {
- mode = "wpa2-sha256";
- wpaPasswordFile = "/run/secrets/hostapd-Nela.pass";
- };
- };
- "${cnf.ar9287.interface}.milan" = {
- bssid = elemAt cnf.ar9287.bssids 2;
- ssid = "MILAN-AC";
- authentication = {
- mode = "wpa2-sha256";
- wpaPasswordFile = "/run/secrets/hostapd-MILAN-AC.pass";
- };
- };
- };
+ networks = networks "ar9287";
};
"${cnf.qca988x.interface}" = mkIf (cnf.qca988x.interface != null) {
countryCode = "CZ";
@@ -82,32 +85,7 @@ in {
enable = true;
inherit (hostapd.qualcomAtherosQCA988x.wifi5) capabilities;
};
- networks = {
- "${cnf.qca988x.interface}" = {
- bssid = elemAt cnf.qca988x.bssids 0;
- ssid = "TurrisAdamkovi";
- authentication = {
- mode = "wpa2-sha256";
- wpaPasswordFile = "/run/secrets/hostapd-TurrisAdamkovi.pass";
- };
- };
- "${cnf.qca988x.interface}-nela" = {
- bssid = elemAt cnf.qca988x.bssids 1;
- ssid = "Nela";
- authentication = {
- mode = "wpa2-sha256";
- wpaPasswordFile = "/run/secrets/hostapd-Nela.pass";
- };
- };
- "${cnf.qca988x.interface}.milan" = {
- bssid = elemAt cnf.qca988x.bssids 2;
- ssid = "MILAN-AC";
- authentication = {
- mode = "wpa2-sha256";
- wpaPasswordFile = "/run/secrets/hostapd-MILAN-AC.pass";
- };
- };
- };
+ networks = networks "qca988x";
};
};
};
diff --git a/nixos/modules/wifi-spt.nix b/nixos/modules/wifi-spt.nix
index d013473..d3f6f68 100644
--- a/nixos/modules/wifi-spt.nix
+++ b/nixos/modules/wifi-spt.nix
@@ -6,6 +6,35 @@
inherit (lib) mkOption mkEnableOption types mkIf mkForce mkMerge hostapd elemAt;
cnf = config.cynerd.wifiAP.spt;
+ networks = name: let
+ is2g = cnf."${name}".channel <= 14;
+ in {
+ "${cnf."${name}".interface}" = {
+ bssid = elemAt cnf."${name}".bssids 0;
+ ssid = "TurrisRules${
+ if is2g
+ then ""
+ else "5"
+ }";
+ authentication = {
+ mode = "wpa2-sha256";
+ wpaPasswordFile = "/run/secrets/hostapd-TurrisRules.pass";
+ };
+ settings = mkIf is2g {
+ ieee80211w = 0;
+ wpa_key_mgmt = mkForce "WPA-PSK"; # force use without sha256
+ };
+ };
+ "${cnf."${name}".interface}.guest" = {
+ bssid = elemAt cnf."${name}".bssids 1;
+ ssid = "Kocovi";
+ authentication = {
+ mode = "wpa2-sha256";
+ wpaPasswordFile = "/run/secrets/hostapd-Kocovi.pass";
+ };
+ };
+ };
+
wOptions = card: channelDefault: {
interface = mkOption {
type = with types; nullOr str;
@@ -48,28 +77,7 @@ in {
enable = true;
inherit (hostapd.qualcomAtherosAR9287.wifi4) capabilities;
};
- networks = {
- "${cnf.ar9287.interface}" = {
- bssid = elemAt cnf.ar9287.bssids 0;
- ssid = "TurrisRules";
- authentication = {
- mode = "wpa2-sha256";
- wpaPasswordFile = "/run/secrets/hostapd-TurrisRules.pass";
- };
- settings = {
- ieee80211w = 0;
- wpa_key_mgmt = mkForce "WPA-PSK"; # force use without sha256
- };
- };
- "${cnf.ar9287.interface}.guest" = {
- bssid = elemAt cnf.ar9287.bssids 1;
- ssid = "Kocovi";
- authentication = {
- mode = "wpa2-sha256";
- wpaPasswordFile = "/run/secrets/hostapd-Kocovi.pass";
- };
- };
- };
+ networks = networks "ar9287";
};
})
(mkIf (cnf.qca988x.interface != null) {
@@ -90,32 +98,7 @@ in {
enable = !is2g;
inherit (hostapd.qualcomAtherosQCA988x.wifi5) capabilities;
};
- networks = {
- "${cnf.qca988x.interface}" = {
- bssid = elemAt cnf.qca988x.bssids 0;
- ssid = "TurrisRules${
- if is2g
- then ""
- else "5"
- }";
- authentication = {
- mode = "wpa2-sha256";
- wpaPasswordFile = "/run/secrets/hostapd-TurrisRules.pass";
- };
- settings = mkIf is2g {
- ieee80211w = 0;
- wpa_key_mgmt = mkForce "WPA-PSK"; # force use without sha256
- };
- };
- "${cnf.qca988x.interface}.guest" = {
- bssid = elemAt cnf.qca988x.bssids 1;
- ssid = "Kocovi";
- authentication = {
- mode = "wpa2-sha256";
- wpaPasswordFile = "/run/secrets/hostapd-Kocovi.pass";
- };
- };
- };
+ networks = networks "qca988x";
};
})
];