dragnpkgs/modules/regdom/default.nix

18 lines
501 B
Nix

{ 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}
'';
}