1 { config, lib, pkgs, ... }:
3 kernelVersion = config.boot.kernelPackages.kernel.version;
4 linuxKernelMinVersion = "5.8";
5 kernelPatch = pkgs.kernelPatches.ath_regd_optional // {
12 options.networking.wireless.athUserRegulatoryDomain = lib.mkOption {
14 type = lib.types.bool;
16 If enabled, sets the ATH_USER_REGD kernel config switch to true to
17 disable the enforcement of EEPROM regulatory restrictions for ath
18 drivers. Requires at least Linux ${linuxKernelMinVersion}.
22 config = lib.mkIf config.networking.wireless.athUserRegulatoryDomain {
23 assertions = lib.singleton {
24 assertion = lib.lessThan 0 (builtins.compareVersions kernelVersion linuxKernelMinVersion);
25 message = "ATH_USER_REGD patch for kernels older than ${linuxKernelMinVersion} not ported yet!";
27 boot.kernelPatches = [ kernelPatch ];