aboutsummaryrefslogtreecommitdiff
path: root/nixos/machine
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2023-01-23 21:23:23 +0100
committerKarel Kočí <cynerd@email.cz>2023-01-23 21:23:23 +0100
commit89a605727649bb4599af04681e40a19bf24e69a4 (patch)
tree1f8ab6de3825c5c1f88f90c9b08a1d223e47e7d0 /nixos/machine
parentd965ae516e238dde8f22234859b81a5a25b7f726 (diff)
downloadnixos-personal-89a605727649bb4599af04681e40a19bf24e69a4.tar.gz
nixos-personal-89a605727649bb4599af04681e40a19bf24e69a4.tar.bz2
nixos-personal-89a605727649bb4599af04681e40a19bf24e69a4.zip
nixos: improve wifi configuration
Diffstat (limited to 'nixos/machine')
-rw-r--r--nixos/machine/adm-omnia.nix4
-rw-r--r--nixos/machine/adm-omnia2.nix6
-rw-r--r--nixos/machine/spt-mox.nix60
-rw-r--r--nixos/machine/spt-mox2.nix70
4 files changed, 45 insertions, 95 deletions
diff --git a/nixos/machine/adm-omnia.nix b/nixos/machine/adm-omnia.nix
index e3a66e1..5fe2127 100644
--- a/nixos/machine/adm-omnia.nix
+++ b/nixos/machine/adm-omnia.nix
@@ -14,8 +14,8 @@ with lib; {
};
wifiAP.adm = {
enable = true;
- w24.interface = "wlp3s0";
- w5.interface = "wlp2s0";
+ ar9287.interface = "wlp3s0";
+ qca988x.interface = "wlp2s0";
};
openvpn.oldpersonal = false;
};
diff --git a/nixos/machine/adm-omnia2.nix b/nixos/machine/adm-omnia2.nix
index ba71e7d..be55d54 100644
--- a/nixos/machine/adm-omnia2.nix
+++ b/nixos/machine/adm-omnia2.nix
@@ -9,8 +9,8 @@ with lib; {
cynerd = {
wifiAP.adm = {
enable = true;
- w24.interface = "wlp3s0";
- w5.interface = "wlp2s0";
+ ar9287.interface = "wlp3s0";
+ qca988x.interface = "wlp2s0";
};
};
@@ -22,7 +22,7 @@ with lib; {
};
};
bridges = {
- brlan.interfaces = [ "end2" "lan0" "lan1" "lan2" "lan3" "lan4" ];
+ brlan.interfaces = ["end2" "lan0" "lan1" "lan2" "lan3" "lan4"];
brguest.interfaces = ["brlan.guest"];
};
interfaces.brlan.ipv4.addresses = [
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 = [];
};
};
}
diff --git a/nixos/machine/spt-mox2.nix b/nixos/machine/spt-mox2.nix
index b504563..32bd9b0 100644
--- a/nixos/machine/spt-mox2.nix
+++ b/nixos/machine/spt-mox2.nix
@@ -6,6 +6,16 @@
}:
with lib; {
config = {
+ cynerd = {
+ wifiAP.spt = {
+ enable = true;
+ qca988x = {
+ interface = "wls1";
+ channel = 7;
+ };
+ };
+ };
+
swapDevices = [
{
device = "/dev/disk/by-partlabel/NixTurrisSwap";
@@ -13,62 +23,26 @@ with lib; {
}
];
- networking.wirelessAP = {
- enable = true;
- environmentFile = "/run/secrets/hostapd.env";
- interfaces = {
- "wls1" = {
- countryCode = "CZ";
- 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 = 2;
- wpaPassphrase = "@PASS_TURRIS_RULES@";
- #bss = {
- # "wlp1s0host" = {
- # ssid = "KocoviGuest";
- # wpa = true;
- # wpaPassphrase = "@PASS_KOCOVI@";
- # };
- #};
- };
- };
- };
-
networking = {
vlans = {
- "eth0.2" = {
+ "brlan.guest" = {
id = 2;
- interface = "eth0";
+ interface = "brlan";
};
};
bridges = {
- brlan = {
- interfaces = [
- "eth0"
- ];
- };
- brguest = {
- interfaces = [
- "eth0.2"
- ];
- };
- };
- interfaces.brlan = {
- ipv4 = {
- addresses = [
- {
- address = config.cynerd.hosts.spt.mox2;
- prefixLength = 24;
- }
- ];
- };
+ brlan.interfaces = ["eth0"];
+ 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 = [];
};
};
}