aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/wifi-client.nix
blob: fd0944a233f99fa8c6321f2ad08c24c6b5985136 (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
{
  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 {
    networking.wireless = {
      enable = true;
      networks = config.secrets.wifiNetworks;
      environmentFile = "/run/secrets/wifi.env";
      userControlled.enable = true;
    };
  };
}