{ lib, config, ... }: { options = { wifi.enable = lib.mkEnableOption "enables wifi"; }; config = lib.mkIf config.wifi.enable { networking.wireless = { enable = true; # Enables wireless support via wpa_supplicant. userControlled.enable = true; allowAuxiliaryImperativeNetworks = true; # Networks defined in aux imperitive networks (/etc/wpa_supplicant.conf) }; # Link /etc/wpa_supplicant.conf -> secret config environment.etc."wpa_supplicant.conf" = { source = config.sops.secrets.wpa_supplicant-conf.path; }; }; }