I’d set that to false (it’s not enabled by default, but it’s part of the default generated config).
If you want to then re-enable specific firmware files you’d need to use pkgs.buildEnv or pkgs.symlinkJoin to extract the specific sub-set of pkgs.linux-firmware; there are no options you could change with .override to only build a subset.
I’d also recommend using the hardware.firmware option instead of nixpkgs.overlays, just to be explicit about what you’re doing; an overlay to override a package an option happens to use is so spaghetti. But I know people use overlays as a cure-all. If all you have is a hammer, everything’s a nail…
If you wanted to, you could replace the packages added to the list with empty mock packages to make them do nothing. So something like this:
final: prev: let
mock-firmware = pkgs.runCommand "mock-firmware" ''
mkdir -p $out/lib/firmware
'';
in
pkgs.lib.listToAttrs (map (name: {
inherit name;
value = mock-firmware;
}) [
"linux-firmware"
"intel2200BGFirmware"
"rtl8192su-firmware"
"rt5677-firmware"
"rtl8761b-firmware"
"zd1211fw"
"alsa-firmware"
"sof-firmware"
"libreelec-dvb-firmware"
"raspberrypiWirelessFirmware"
# Remember to update this list when
# any packages are added; no, we cannot
# use the value of `hardware.firmware` since
# the overlay applies to attributes, and `pname`
# doesn't necessarily match the attribute name
])
But that’s ridiculously stupid. Just make the list empty to begin with, either by disabling all the options that add packages to it, or with lib.mkForce [ ].
If you’re asking how you’d replace the firmware packages with one you wrote, you can do this:
… or this, if you don’t want to merge the list of firmwares; I don’t recommend it, the above is much cleaner in case you have another module that wants to add firmware. It’s better to know where your firmware packages are coming from and why they’re there: