aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/wifi-client.nix
blob: 8fc803dc0be610fd500fa1a096941b4cab29aab8 (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
{
  config,
  lib,
  pkgs,
  ...
}: let
  inherit (lib) mkOption types mkIf;
in {
  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;
    };
  };
}