{ lib, config, pkgs, ... }: let inherit (lib) mkEnableOption mkIf; cfg = config.horseman.hardware.wifi; in { options = { horseman.hardware.wifi = { enable = mkEnableOption ""; }; }; config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ wpa_supplicant_gui ]; networking.wireless = { enable = true; userControlled.enable = true; allowAuxiliaryImperativeNetworks = true; secretsFile = toString config.age.secrets.wifi.path; networks = { "Wi-Fi de Ruiters" = { pskRaw = "ext:psk_ruiter"; }; "kargadoor" = { pskRaw = "ext:psk_kargadoor"; }; "Hete plek" = { pskRaw = "ext:psk_hotspot"; }; "Woestgaafsecure Gamelab" = { pskRaw = "ext:psk_sticky"; }; "Utrecht University" = { authProtocols = ["WPA-EAP"]; auth = '' eap=PEAP identity=ext:identity_uni password=ext:psk_uni phase2="auth=MSCHAPV2" ''; }; }; }; }; }