aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/wifi-client.nix
blob: 0d7fd48cd75d7b2a0fd9a99599a723dd8b08a5da (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
{
  config,
  lib,
  pkgs,
  ...
}:
with lib; {
  options = {
    cynerd.wifiClient = mkOption {
      type = types.bool;
      default = false;
      description = "Enable Wi-Fi client support";
    };
  };

  config = mkIf config.cynerd.wifiClient {
    environment.systemPackages = with pkgs; [
      wpa_supplicant_gui
    ];
    networking.wireless = {
      enable = true;
      networks = config.secrets.wifiNetworks;
      environmentFile = "/run/secrets/wifi.env";
      userControlled.enable = true;
    };
  };
}