aboutsummaryrefslogtreecommitdiff
path: root/2024-installfest/wifi.nix
blob: ae6531e79645a9b878820c58253ad395b391f8a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{lib, ...}: {
  nixpkgs.config.allowUnfree = true;
  hardware.enableAllFirmware = true;
  boot.extraModprobeConfig = ''
    options cfg80211 ieee80211_regdom="CZ"
  '';
  services.hostapd = {
    enable = true;
    radios = {
      "wlp3s0" = {
        channel = 7;
        countryCode = "CZ";
        wifi4 = {
          enable = true;
          inherit (lib.hostapd.qualcomAtherosAR9287.wifi4) capabilities;
        };
        networks."wlp3s0" = {
          ssid = "NixOSInstallFest";
          authentication = {
            mode = "wpa2-sha256";
            wpaPassword = "InstallFest2024";
          };
        };
      };
      "wlp2s0" = {
        channel = 36;
        band = "5g";
        countryCode = "CZ";
        wifi4 = {
          enable = true;
          inherit (lib.hostapd.qualcomAtherosQCA988x.wifi4) capabilities;
        };
        wifi5 = {
          enable = true;
          inherit (lib.hostapd.qualcomAtherosQCA988x.wifi5) capabilities;
        };
        networks."wlp2s0" = {
          ssid = "NixOSInstallFest5";
          authentication = {
            mode = "wpa2-sha256";
            wpaPassword = "InstallFest2024";
          };
        };
      };
    };
  };

  systemd.network.networks = {
    "lan-wlp3s0" = {
      matchConfig.Name = "wlp3s0";
      networkConfig.Bridge = "brlan";
    };
    "lan-wlp2s0" = {
      matchConfig.Name = "wlp2s0";
      networkConfig.Bridge = "brlan";
    };
  };
}