I have this in hardware-configuraiton.nix:
hardware = {
enableAllFirmware = true;
enableRedistributableFirmware = true;
# NOTE: When 21.11 lands, swap for:
# wirelessRegulatoryDatabase = true;
firmware = [ pkgs.wireless-regdb ];
cpu.intel.updateMicrocode = true;
}
I got the config example from hardware.nix - jkachmar/dotnix - Sourcegraph
When I check logs I got this:
$ journalctl -b 0 --grep regulatory
-- Journal begins at Tue 2021-11-09 20:09:36 CET, ends at Mon 2021-11-29 12:14:11 CET. --
lis 29 11:31:25 msi-laptop kernel: cfg80211: Loading compiled-in X.509 certificates for regulatory database
lis 29 11:31:25 msi-laptop kernel: platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
lis 29 11:31:25 msi-laptop kernel: cfg80211: failed to load regulatory.db
Kernel seems to have required options enabled:
$ zgrep REGDB /proc/config.gz
CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y
CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y
$ uname -a
Linux msi-laptop 5.10.81 #1-NixOS SMP Sun Nov 21 12:46:37 UTC 2021 x86_64 GNU/Linux
There is issue Provide regulatory.db info via /lib/firmware when supported · Issue #57053 · NixOS/nixpkgs · GitHub and PR nixos: add option to load wireless regulatory database as firmware by symphorien · Pull Request #121530 · NixOS/nixpkgs · GitHub but I am not sure if this is relevant.
Also how to set permanently regdomain?
arch wiki talks about setting like this:
A more permanent configuration of the regdomain can be achieved through editing
/etc/conf.d/wireless-regdom
and uncommenting the appropriate domain.wpa_supplicant can also use a regdomain in the
country=
line of/etc/wpa_supplicant/wpa_supplicant.conf
.It is also possible to configure the cfg80211 kernel module to use a specific regdomain by adding, for example,
options cfg80211 ieee80211_regdom=JP
as module options. The module option is inherited from the old regulatory implementation and in modern kernels act as a userspace regulatory hint as if it came throughnl80211
through utilities likeiw
andwpa_supplicant
.
https://wiki.archlinux.org/title/Network_configuration/Wireless#Respecting_the_regulatory_domain
Edit: Is it because I don’t have /lib/firmware
directory?
Download wireless-regdb 2017.12.23, untar, and copy regulatory.db and regulatory.db.p7s to /lib/firmware; full ok.