mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 19:46:17 +01:00
a65bf608df
Signed-off-by: magic_rb <magic_rb@redalder.org>
154 lines
3.9 KiB
Nix
154 lines
3.9 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
inputs',
|
|
config,
|
|
...
|
|
}: {
|
|
services.udev.extraRules = ''
|
|
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:43:26:60:10", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
|
|
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:43:26:60:11", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan1"
|
|
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:43:26:60:38", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan2"
|
|
'';
|
|
|
|
services.hostapd = {
|
|
package = inputs'.nixpkgs-unstable.legacyPackages.${pkgs.system}.hostapd;
|
|
enable = true;
|
|
radios.wlan0 = {
|
|
networks.wlan0 = {
|
|
ssid = "bpir4-2g";
|
|
authentication = {
|
|
mode = "wpa2-sha256";
|
|
wpaPassword = "you guess, its your mom";
|
|
};
|
|
};
|
|
};
|
|
radios.wlan1 = {
|
|
networks.wlan1 = {
|
|
ssid = "bpir4-5g";
|
|
authentication = {
|
|
mode = "wpa2-sha256";
|
|
wpaPassword = "you guess, its your mom";
|
|
};
|
|
};
|
|
};
|
|
radios.wlan2 = {
|
|
networks.wlan2 = {
|
|
ssid = "bpir4-6g";
|
|
authentication = {
|
|
mode = "wpa2-sha256";
|
|
wpaPassword = "you guess, its your mom";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
systemd.services.hostapd = {
|
|
after = lib.mkForce ["ifstate.service"];
|
|
bindsTo = lib.mkForce [];
|
|
serviceConfig.NetworkNamespacePath = "/var/run/netns/hel";
|
|
preStart = lib.mkForce ''
|
|
_5g_config="$RUNTIME_DIRECTORY/5g.conf"
|
|
_psk="$(cat "/persist/wlan.psk")"
|
|
cp ${./hostapd/bpi-r4-best-5g.conf} "$_5g_config"
|
|
sed -i "s~PASSPHRASE~$_psk~" "$_5g_config"
|
|
'';
|
|
serviceConfig = {
|
|
ExecStart = lib.mkForce (pkgs.writeShellScript "hostapd-start.sh" ''
|
|
${config.services.hostapd.package}/bin/hostapd $RUNTIME_DIRECTORY/5g.conf
|
|
'');
|
|
};
|
|
};
|
|
|
|
# services.hostapd = {
|
|
# package = inputs'.nixpkgs-unstable.legacyPackages.${pkgs.system}.hostapd;
|
|
# enable = true;
|
|
# radios.wlan0 = {
|
|
# band = "2g";
|
|
# networks.wlan0 = {
|
|
# ssid = "bpi-2g";
|
|
# authentication = {
|
|
# mode = "wpa2-sha256";
|
|
# wpaPassword = "you guess, its your mom";
|
|
# };
|
|
# };
|
|
# countryCode = "NL";
|
|
# channel = 0;
|
|
# wifi4 = {
|
|
# enable = true;
|
|
# capabilities = [
|
|
# "LDPC"
|
|
# # "HT40+"
|
|
# # "HT40-"
|
|
# "GF"
|
|
# "SHORT-GI-20"
|
|
# "SHORT-GI-40"
|
|
# "TX-STBC"
|
|
# "RX-STBC1"
|
|
# ];
|
|
# };
|
|
# wifi5.enable = false;
|
|
# wifi6.enable = true;
|
|
# };
|
|
# radios.wlan1 = {
|
|
# band = "5g";
|
|
# networks.wlan1 = {
|
|
# ssid = "bpi-5g";
|
|
# authentication = {
|
|
# mode = "wpa2-sha256";
|
|
# wpaPassword = "you guess, its your mom";
|
|
# };
|
|
# };
|
|
# countryCode = "NL";
|
|
# channel = 0;
|
|
# wifi4 = {
|
|
# enable = true;
|
|
# capabilities = [
|
|
# "LDPC"
|
|
# # "HT40+"
|
|
# # "HT40-"
|
|
# "GF"
|
|
# "SHORT-GI-20"
|
|
# "SHORT-GI-40"
|
|
# "TX-STBC"
|
|
# "RX-STBC1"
|
|
# ];
|
|
# };
|
|
# wifi5 = {
|
|
# enable = true;
|
|
# };
|
|
# wifi6 = {
|
|
# enable = true;
|
|
# multiUserBeamformer = true;
|
|
# };
|
|
# };
|
|
# radios.wlan2 = {
|
|
# band = "6g";
|
|
# networks.wlan2 = {
|
|
# ssid = "bpi-6g";
|
|
# authentication = {
|
|
# mode = "wpa2-sha256";
|
|
# wpaPassword = "you guess, its your mom";
|
|
# };
|
|
# };
|
|
# countryCode = "NL";
|
|
# channel = 0;
|
|
# wifi4 = {
|
|
# enable = false;
|
|
# capabilities = [];
|
|
# };
|
|
# wifi5 = {
|
|
# enable = false;
|
|
# };
|
|
# wifi6 = {
|
|
# enable = true;
|
|
# multiUserBeamformer = true;
|
|
# };
|
|
# wifi7 = {
|
|
# enable = true;
|
|
# multiUserBeamformer = true;
|
|
# };
|
|
# };
|
|
# };
|
|
}
|