{ config, pkgs, lib, ... }: with lib; let cfg = config.hardware.wirelessRegulatoryDomain; in { options.hardware.wirelessRegulatoryDomain = mkOption { description = "The wireless regulatory domain to set in the kernel cfg80211 module"; type = with types; nullOr str; default = null; defaultText = literalExpression "null"; example = literalExpression "\"US\""; }; config.boot.extraModprobeConfig = mkIf (cfg != null) '' options cfg80211 ieee80211_regdom=${cfg} ''; }